diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 691430a4d..cc43fb362 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1735,6 +1735,12 @@ void ObjectMgr::LoadItemPrototypes() const_cast(proto)->Stackable = 1000; } + if(proto->ContainerSlots > MAX_BAG_SIZE) + { + sLog.outErrorDb("Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).",i,proto->ContainerSlots,MAX_BAG_SIZE); + const_cast(proto)->ContainerSlots = MAX_BAG_SIZE; + } + if(proto->StatsCount > MAX_ITEM_PROTO_STATS) { sLog.outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).",i,proto->StatsCount,MAX_ITEM_PROTO_STATS); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index d6cc2521b..02fb26102 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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::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; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a2605425c..e3f2e604c 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 "8090" + #define REVISION_NR "8091" #endif // __REVISION_NR_H__