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
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user