diff options
Diffstat (limited to '')
-rw-r--r-- | source/Inventory.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/Inventory.cpp b/source/Inventory.cpp index b56f50ed7..74294e80e 100644 --- a/source/Inventory.cpp +++ b/source/Inventory.cpp @@ -336,6 +336,22 @@ bool cInventory::DamageEquippedItem(short a_Amount) +int cInventory::ChangeSlotCount(int a_SlotNum, int a_AddToCount) +{ + int GridSlotNum = 0; + cItemGrid * Grid = GetGridForSlotNum(a_SlotNum, GridSlotNum); + if (Grid == NULL) + { + LOGWARNING("%s: invalid slot number, expected 0 .. %d, got %d; ignoring", __FUNCTION__, invNumSlots, a_SlotNum); + return -1; + } + return Grid->ChangeSlotCount(GridSlotNum, a_AddToCount); +} + + + + + bool cInventory::DamageItem(int a_SlotNum, short a_Amount) { if ((a_SlotNum < 0) || (a_SlotNum >= invNumSlots)) |