mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7512] Implement checks of item bag mask at server startup.
This commit is contained in:
parent
2885091dfe
commit
38395ac07d
7 changed files with 32 additions and 3 deletions
|
|
@ -557,7 +557,7 @@ struct ItemPrototype
|
||||||
uint32 MaxDurability;
|
uint32 MaxDurability;
|
||||||
uint32 Area; // id from AreaTable.dbc
|
uint32 Area; // id from AreaTable.dbc
|
||||||
uint32 Map; // id from Map.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
|
uint32 TotemCategory; // id from TotemCategory.dbc
|
||||||
_Socket Socket[MAX_ITEM_PROTO_SOCKETS];
|
_Socket Socket[MAX_ITEM_PROTO_SOCKETS];
|
||||||
uint32 socketBonus; // id from SpellItemEnchantment.dbc
|
uint32 socketBonus; // id from SpellItemEnchantment.dbc
|
||||||
|
|
|
||||||
|
|
@ -1715,6 +1715,24 @@ void ObjectMgr::LoadItemPrototypes()
|
||||||
if(proto->Map && !sMapStore.LookupEntry(proto->Map))
|
if(proto->Map && !sMapStore.LookupEntry(proto->Map))
|
||||||
sLog.outErrorDb("Item (Entry: %u) has wrong Map (%u)",i,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))
|
if(proto->TotemCategory && !sTotemCategoryStore.LookupEntry(proto->TotemCategory))
|
||||||
sLog.outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)",i,proto->TotemCategory);
|
sLog.outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)",i,proto->TotemCategory);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore(GtRegenHPPerSptf
|
||||||
DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore(GtRegenMPPerSptfmt);
|
DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore(GtRegenMPPerSptfmt);
|
||||||
DBCStorage <HolidaysEntry> sHolidaysStore(Holidaysfmt);
|
DBCStorage <HolidaysEntry> sHolidaysStore(Holidaysfmt);
|
||||||
DBCStorage <ItemEntry> sItemStore(Itemfmt);
|
DBCStorage <ItemEntry> sItemStore(Itemfmt);
|
||||||
|
DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore(ItemBagFamilyfmt);
|
||||||
//DBCStorage <ItemCondExtCostsEntry> sItemCondExtCostsStore(ItemCondExtCostsEntryfmt);
|
//DBCStorage <ItemCondExtCostsEntry> sItemCondExtCostsStore(ItemCondExtCostsEntryfmt);
|
||||||
//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
|
//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
|
||||||
DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt);
|
DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt);
|
||||||
|
|
@ -194,7 +195,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||||
{
|
{
|
||||||
std::string dbcPath = dataPath+"dbc/";
|
std::string dbcPath = dataPath+"dbc/";
|
||||||
|
|
||||||
const uint32 DBCFilesCount = 73;
|
const uint32 DBCFilesCount = 74;
|
||||||
|
|
||||||
barGoLink bar( DBCFilesCount );
|
barGoLink bar( DBCFilesCount );
|
||||||
|
|
||||||
|
|
@ -269,6 +270,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenMPPerSptStore, dbcPath,"gtRegenMPPerSpt.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenMPPerSptStore, dbcPath,"gtRegenMPPerSpt.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sHolidaysStore, dbcPath,"Holidays.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sHolidaysStore, dbcPath,"Holidays.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemStore, dbcPath,"Item.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemStore, dbcPath,"Item.dbc");
|
||||||
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemBagFamilyStore, dbcPath,"ItemBagFamily.dbc");
|
||||||
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently
|
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently
|
||||||
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc");
|
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemExtendedCostStore, dbcPath,"ItemExtendedCost.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemExtendedCostStore, dbcPath,"ItemExtendedCost.dbc");
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,7 @@ extern DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore;
|
||||||
extern DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore;
|
extern DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore;
|
||||||
extern DBCStorage <HolidaysEntry> sHolidaysStore;
|
extern DBCStorage <HolidaysEntry> sHolidaysStore;
|
||||||
extern DBCStorage <ItemEntry> sItemStore;
|
extern DBCStorage <ItemEntry> sItemStore;
|
||||||
|
extern DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore;
|
||||||
//extern DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore; -- not used currently
|
//extern DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore; -- not used currently
|
||||||
extern DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore;
|
extern DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore;
|
||||||
extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore;
|
extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore;
|
||||||
|
|
|
||||||
|
|
@ -901,6 +901,13 @@ struct ItemEntry
|
||||||
uint32 Sheath; // 7
|
uint32 Sheath; // 7
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ItemBagFamilyEntry
|
||||||
|
{
|
||||||
|
uint32 ID; // 0
|
||||||
|
//char* name[16] // 1-16 m_name_lang
|
||||||
|
// // 17 name flags
|
||||||
|
};
|
||||||
|
|
||||||
struct ItemDisplayInfoEntry
|
struct ItemDisplayInfoEntry
|
||||||
{
|
{
|
||||||
uint32 ID; // 0 m_ID
|
uint32 ID; // 0 m_ID
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ const char GtRegenHPPerSptfmt[]="f";
|
||||||
const char GtRegenMPPerSptfmt[]="f";
|
const char GtRegenMPPerSptfmt[]="f";
|
||||||
const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||||
const char Itemfmt[]="nixiiiii";
|
const char Itemfmt[]="nixiiiii";
|
||||||
|
const char ItemBagFamilyfmt[]="nxxxxxxxxxxxxxxxxx";
|
||||||
//const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
|
//const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
|
||||||
//const char ItemCondExtCostsEntryfmt[]="xiii";
|
//const char ItemCondExtCostsEntryfmt[]="xiii";
|
||||||
const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiix";
|
const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiix";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7511"
|
#define REVISION_NR "7512"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue