mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +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
f420fdde77
commit
ac7a7417fe
3 changed files with 8 additions and 2 deletions
|
|
@ -1735,6 +1735,12 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
const_cast<ItemPrototype*>(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<ItemPrototype*>(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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue