]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/pouch.cpp
added a parameter to the tavern buy command that allows you to specify how many items...
[irc/gameservirc.git] / gameserv / pouch.cpp
index 85655af42c4d89bfbddda473f95bfbb9f41fc0e8..04367316fc426d9e7b9a3ed481f00c3afab0b26e 100644 (file)
@@ -90,6 +90,23 @@ itemContainer *pouch::addItem(item *i)
   sort();
   return &items.front();
 }
+itemContainer *pouch::addItem(item *i, int amt)
+{
+  if (count >= 3000 || count + amt >= maxitems)
+       {
+         return NULL;
+       }
+
+  for (int x=0; x < amt; x++)
+       {
+         itemContainer it(i);
+         items.push_front(it);
+         ++count;
+       }
+  sort();
+  return &items.front();
+}
+
 itemContainer *pouch::addItemNoChecks(item *i)
 {
   itemContainer it(i);