summaryrefslogtreecommitdiff
path: root/src/game-server/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/inventory.cpp')
-rw-r--r--src/game-server/inventory.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game-server/inventory.cpp b/src/game-server/inventory.cpp
index 7bbaf483..1cc92145 100644
--- a/src/game-server/inventory.cpp
+++ b/src/game-server/inventory.cpp
@@ -228,6 +228,15 @@ unsigned int Inventory::count(unsigned int itemId) const
return nb;
}
+int Inventory::getFirstSlot(unsigned int itemId)
+{
+ for (InventoryData::iterator it = mPoss->inventory.begin(),
+ it_end = mPoss->inventory.end(); it != it_end; ++it)
+ if (it->second.itemId == itemId)
+ return (int)it->first;
+ return -1;
+}
+
unsigned int Inventory::remove(unsigned int itemId, unsigned int amount)
{
if (!itemId || !amount)