From 40a03daf823a66e89b4bbcb758545a040542f083 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 21 Mar 2009 22:43:47 -0600 Subject: [7512] Implement checks of item bag mask at server startup. Author: VladimirMangos --HG-- branch : trunk --- src/game/ObjectMgr.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/game/ObjectMgr.cpp') 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(proto)->BagFamily &= ~mask; + } + } + } + if(proto->TotemCategory && !sTotemCategoryStore.LookupEntry(proto->TotemCategory)) sLog.outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)",i,proto->TotemCategory); -- cgit v1.2.3