]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/player.cpp
updated the Change log w/ new additions
[irc/gameservirc.git] / gameserv / player.cpp
index dbdaa1dffc4f1b25c53957c398f4e2fb60bbd2e4..f0651239560571247903f529d86ce56d742afb99 100644 (file)
@@ -68,6 +68,8 @@ Player::Player(char *n)
 
 Player::Player(string n)
 {
+  if (inventory != NULL)
+       delete inventory;
   inventory = new pouch();
   reset();
   name = n;
@@ -77,24 +79,23 @@ Player::Player(string 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\