From 90e0656c7562fc1761fefc023df56078732da3c0 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 24 May 2013 09:16:09 +0000 Subject: Slight cleanup in the cInventory / cItemGrid API git-svn-id: http://mc-server.googlecode.com/svn/trunk@1504 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ItemGrid.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/ItemGrid.cpp') diff --git a/source/ItemGrid.cpp b/source/ItemGrid.cpp index aa8ed92c8..f1330dd56 100644 --- a/source/ItemGrid.cpp +++ b/source/ItemGrid.cpp @@ -346,6 +346,15 @@ int cItemGrid::ChangeSlotCount(int a_SlotNum, int a_AddToCount) +int cItemGrid::ChangeSlotCount(int a_X, int a_Y, int a_AddToCount) +{ + return ChangeSlotCount(GetSlotNum(a_X, a_Y), a_AddToCount); +} + + + + + int cItemGrid::HowManyItems(const cItem & a_Item) { int res = 0; @@ -443,6 +452,15 @@ bool cItemGrid::DamageItem(int a_SlotNum, short a_Amount) +bool cItemGrid::DamageItem(int a_X, int a_Y, short a_Amount) +{ + return DamageItem(GetSlotNum(a_X, a_Y), a_Amount); +} + + + + + void cItemGrid::GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, int a_CountLootProbabs, int a_NumSlots, int a_Seed) { // Calculate the total weight: -- cgit v1.2.3