Core/Players: Fixed crash in GetBagByPos

This commit is contained in:
Shauren
2011-03-18 15:41:39 +01:00
parent fa8b30a45c
commit 489e629437
+2 -1
View File
@@ -10046,7 +10046,8 @@ Bag* Player::GetBagByPos(uint8 bag) const
{
if ((bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)
|| (bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END))
return GetItemByPos(INVENTORY_SLOT_BAG_0, bag)->ToBag();
if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, bag))
return item->ToBag();
return NULL;
}