From cd8720bf7e07c681ef90ba6159afbf53f5546ed2 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 26 Jul 2013 19:50:06 +0000 Subject: cInventory: Added the ChangeSlotCount() function to the Lua API git-svn-id: http://mc-server.googlecode.com/svn/trunk@1683 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Inventory.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/Inventory.h') diff --git a/source/Inventory.h b/source/Inventory.h index 9ddd00ecd..f8f8042f4 100644 --- a/source/Inventory.h +++ b/source/Inventory.h @@ -130,6 +130,12 @@ public: void SetEquippedSlotNum(int a_SlotNum); int GetEquippedSlotNum(void) { return m_EquippedSlotNum; } + /** Adds (or subtracts, if a_AddToCount is negative) to the count of items in the specified slot. + If the slot is empty, ignores the call. + Returns the new count, or -1 if the slot number is invalid. + */ + int ChangeSlotCount(int a_SlotNum, int a_AddToCount); + /// Adds the specified damage to the specified item; deletes the item and returns true if the item broke. bool DamageItem(int a_SlotNum, short a_Amount); -- cgit v1.2.3