1
0

cItemGrid: Added IsSlotEmpty() functions

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1585 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-06-13 06:13:56 +00:00
parent 9cef5838a8
commit 5c38a831bf
6 changed files with 113 additions and 10 deletions

View File

@@ -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++)