cItemGrid: ChangeSlotCount() now returns -1 if invalid SlotNum
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1684 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
cd8720bf7e
commit
fa66659456
@ -345,10 +345,10 @@ int cItemGrid::ChangeSlotCount(int a_SlotNum, int a_AddToCount)
|
|||||||
{
|
{
|
||||||
if ((a_SlotNum < 0) || (a_SlotNum >= m_NumSlots))
|
if ((a_SlotNum < 0) || (a_SlotNum >= m_NumSlots))
|
||||||
{
|
{
|
||||||
LOGWARNING("%s: Invalid slot number %d out of %d slots, ignoring the call, returning empty item",
|
LOGWARNING("%s: Invalid slot number %d out of %d slots, ignoring the call, returning -1",
|
||||||
__FUNCTION__, a_SlotNum, m_NumSlots
|
__FUNCTION__, a_SlotNum, m_NumSlots
|
||||||
);
|
);
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Slots[a_SlotNum].IsEmpty())
|
if (m_Slots[a_SlotNum].IsEmpty())
|
||||||
|
Loading…
Reference in New Issue
Block a user