Player::Player(string n)
{
+ if (inventory != NULL)
+ delete inventory;
inventory = new pouch();
reset();
name = n;
}
Player::~Player()
-{
- delete inventory;
-
+{
+ if (inventory != NULL)
+ delete inventory;
+
+ delMonster();
+ delMaster();
+ delBattle();
#ifdef DEBUGMODE
string *output;
output = new string("Deleting Player");
-#endif
-
-#ifdef DEBUGMODE
*output += ": " + name;
-#endif
-
-#ifdef DEBUGMODE
*output += " Password: " + password;
log ("%s", output->c_str());
delete output;
#endif
}
+
void Player::setPassword(const char *p)
{
static char saltChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\