mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8091] Check bag size at item protos loading and item slots at invetory loading.
This is single not safe places in work with bag slots in current code.
This commit is contained in:
parent
fad9c4c0b3
commit
5a8640a69b
3 changed files with 8 additions and 2 deletions
|
|
@ -14756,7 +14756,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
|
|||
item->SetSlot(NULL_SLOT);
|
||||
// the item is in a bag, find the bag
|
||||
std::map<uint64, Bag*>::const_iterator itr = bagMap.find(bag_guid);
|
||||
if(itr != bagMap.end())
|
||||
if(itr != bagMap.end() && slot < itr->second->GetBagSize())
|
||||
itr->second->StoreItem(slot, item, true );
|
||||
else
|
||||
success = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue