summaryrefslogtreecommitdiffstats
path: root/source/ItemGrid.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-13 08:13:56 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-13 08:13:56 +0200
commit5c38a831bf0bda271a45f143700b3fea5e6ea7ee (patch)
tree462a6e2d32fb132940a27ae5d782530b29f0a9c5 /source/ItemGrid.cpp
parentChestEntity: fixed bindings (diff)
downloadcuberite-5c38a831bf0bda271a45f143700b3fea5e6ea7ee.tar
cuberite-5c38a831bf0bda271a45f143700b3fea5e6ea7ee.tar.gz
cuberite-5c38a831bf0bda271a45f143700b3fea5e6ea7ee.tar.bz2
cuberite-5c38a831bf0bda271a45f143700b3fea5e6ea7ee.tar.lz
cuberite-5c38a831bf0bda271a45f143700b3fea5e6ea7ee.tar.xz
cuberite-5c38a831bf0bda271a45f143700b3fea5e6ea7ee.tar.zst
cuberite-5c38a831bf0bda271a45f143700b3fea5e6ea7ee.zip
Diffstat (limited to 'source/ItemGrid.cpp')
-rw-r--r--source/ItemGrid.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/ItemGrid.cpp b/source/ItemGrid.cpp
index 5284f3ae1..c62ea6bcc 100644
--- a/source/ItemGrid.cpp
+++ b/source/ItemGrid.cpp
@@ -175,6 +175,31 @@ void cItemGrid::EmptySlot(int a_SlotNum)
+bool cItemGrid::IsSlotEmpty(int a_SlotNum) const
+{
+ if ((a_SlotNum < 0) || (a_SlotNum >= m_NumSlots))
+ {
+ LOGWARNING("%s: Invalid slot number %d out of %d slots",
+ __FUNCTION__, a_SlotNum, m_NumSlots
+ );
+ return true;
+ }
+ return m_Slots[a_SlotNum].IsEmpty();
+}
+
+
+
+
+
+bool cItemGrid::IsSlotEmpty(int a_X, int a_Y) const
+{
+ return IsSlotEmpty(GetSlotNum(a_X, a_Y));
+}
+
+
+
+
+
void cItemGrid::Clear(void)
{
for (int i = 0; i < m_NumSlots; i++)