diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 77c2e8f8668..354272a5189 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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::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; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 68bc525a18b..aee05d28db1 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8901" + #define REVISION_NR "8902" #endif // __REVISION_NR_H__