diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-13 08:13:56 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-13 08:13:56 +0200 |
commit | 5c38a831bf0bda271a45f143700b3fea5e6ea7ee (patch) | |
tree | 462a6e2d32fb132940a27ae5d782530b29f0a9c5 /source/ItemGrid.cpp | |
parent | ChestEntity: fixed bindings (diff) | |
download | cuberite-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.cpp | 25 |
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++)
|