summaryrefslogtreecommitdiffstats
path: root/source/ItemGrid.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-24 11:16:09 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-24 11:16:09 +0200
commit90e0656c7562fc1761fefc023df56078732da3c0 (patch)
tree9595db614f319071e7b0fe5345eb3c0e7f9171bf /source/ItemGrid.cpp
parentRefactored cInventory to use cItemGrid for the actual Storage (diff)
downloadcuberite-90e0656c7562fc1761fefc023df56078732da3c0.tar
cuberite-90e0656c7562fc1761fefc023df56078732da3c0.tar.gz
cuberite-90e0656c7562fc1761fefc023df56078732da3c0.tar.bz2
cuberite-90e0656c7562fc1761fefc023df56078732da3c0.tar.lz
cuberite-90e0656c7562fc1761fefc023df56078732da3c0.tar.xz
cuberite-90e0656c7562fc1761fefc023df56078732da3c0.tar.zst
cuberite-90e0656c7562fc1761fefc023df56078732da3c0.zip
Diffstat (limited to '')
-rw-r--r--source/ItemGrid.cpp18
1 files changed, 18 insertions, 0 deletions
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: