[7512] Implement checks of item bag mask at server startup.

This commit is contained in:
VladimirMangos 2009-03-22 03:19:54 +03:00
parent 2885091dfe
commit 38395ac07d
7 changed files with 32 additions and 3 deletions

View file

@ -1715,6 +1715,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);