[8902] Do can store check at loading item to bag in same way as for other cases

This commit is contained in:
VladimirMangos 2009-12-02 12:30:34 +03:00
parent 68581bd918
commit d5d3f6d26a
2 changed files with 10 additions and 3 deletions

View file

@ -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;
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8901"
#define REVISION_NR "8902"
#endif // __REVISION_NR_H__