mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8902] Do can store check at loading item to bag in same way as for other cases
This commit is contained in:
parent
68581bd918
commit
d5d3f6d26a
2 changed files with 10 additions and 3 deletions
|
|
@ -15289,9 +15289,9 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
|
|||
|
||||
bool success = true;
|
||||
|
||||
// the item/bag is not in a bag
|
||||
if (!bag_guid)
|
||||
{
|
||||
// the item is not in a bag
|
||||
item->SetContainer( NULL );
|
||||
item->SetSlot(slot);
|
||||
|
||||
|
|
@ -15327,13 +15327,20 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
|
|||
bagMap[item_guid] = (Bag*)item;
|
||||
}
|
||||
}
|
||||
// the item/bag in a bag
|
||||
else
|
||||
{
|
||||
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() && slot < itr->second->GetBagSize())
|
||||
itr->second->StoreItem(slot, item, true );
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
if( CanStoreItem( itr->second->GetSlot(), slot, dest, item, false ) == EQUIP_ERR_OK )
|
||||
item = StoreItem(dest, item, true);
|
||||
else
|
||||
success = false;
|
||||
}
|
||||
else
|
||||
success = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8901"
|
||||
#define REVISION_NR "8902"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue