diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/ItemPrototype.h | 2 | ||||
-rw-r--r-- | src/game/ObjectMgr.cpp | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h index caf878da7e1..3967b37622b 100644 --- a/src/game/ItemPrototype.h +++ b/src/game/ItemPrototype.h @@ -559,7 +559,7 @@ struct ItemPrototype uint32 MaxDurability; uint32 Area; // id from AreaTable.dbc uint32 Map; // id from Map.dbc - uint32 BagFamily; // id from ItemBagFamily.dbc + uint32 BagFamily; // bit string (1 << id from ItemBagFamily.dbc) uint32 TotemCategory; // id from TotemCategory.dbc _Socket Socket[MAX_ITEM_PROTO_SOCKETS]; uint32 socketBonus; // id from SpellItemEnchantment.dbc diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 0db8a328d3f..fec531f96d9 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1810,6 +1810,24 @@ void ObjectMgr::LoadItemPrototypes() if(proto->Map && !sMapStore.LookupEntry(proto->Map)) sLog.outErrorDb("Item (Entry: %u) has wrong Map (%u)",i,proto->Map); + if(proto->BagFamily) + { + // check bits + for(uint32 i = 0; i < sizeof(proto->BagFamily)*8; ++i) + { + uint32 mask = 1 << i; + if((proto->BagFamily & mask)==0) + continue; + + ItemBagFamilyEntry const* bf = sItemBagFamilyStore.LookupEntry(i+1); + if(!bf) + { + sLog.outErrorDb("Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit",i); + const_cast<ItemPrototype*>(proto)->BagFamily &= ~mask; + } + } + } + if(proto->TotemCategory && !sTotemCategoryStore.LookupEntry(proto->TotemCategory)) sLog.outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)",i,proto->TotemCategory); |