]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/pouch.cpp
updated the Change log w/ new additions
[irc/gameservirc.git] / gameserv / pouch.cpp
index 88a6e4929d0481175251e1f7a431e2400157a20f..01964bd4df12bc4f6e43cfd1de1f3c91e790c207 100644 (file)
@@ -29,6 +29,7 @@ pouch::pouch(pouch *p)
 void pouch::clear()
 {
   items.clear();
+  count = 0;
 }
 
 bool pouch::isEmpty()
@@ -138,12 +139,14 @@ itemContainer *pouch::addItemNoChecks(item *i)
 void pouch::deleteItem(item *i)
 {
   list<itemContainer>::iterator item_iter;
-  count--;
   
   item_iter = find(items.begin(), items.end(), i);
-  
+
   if (item_iter != items.end())
-    items.erase(item_iter);
+       {
+         items.erase(item_iter);
+         count--;
+       }
 }
 
 const pouch &pouch::operator=(const pouch &right)