Core/Players: Fixed crash in GetBagByPos
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user