From b372a5ba25361c8cb0792abe6e5221a3413fc40c Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 21 May 2009 10:00:44 -0500 Subject: *Load gobject display info from dbc to check go boundaries. --HG-- branch : trunk --- src/game/DBCStores.cpp | 16 ++++++++++++++++ src/game/DBCStores.h | 1 + src/game/DBCStructure.h | 14 ++++++++++++++ src/game/DBCfmt.h | 1 + 4 files changed, 32 insertions(+) (limited to 'src') diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 2c7c15d1796..4f09e039f3e 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -66,6 +66,8 @@ static FactionTeamMap sFactionTeamMap; DBCStorage sFactionStore(FactionEntryfmt); DBCStorage sFactionTemplateStore(FactionTemplateEntryfmt); +DBCStorage sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt); + DBCStorage sGemPropertiesStore(GemPropertiesEntryfmt); DBCStorage sGlyphPropertiesStore(GlyphPropertiesfmt); DBCStorage sGlyphSlotStore(GlyphSlotfmt); @@ -263,6 +265,20 @@ void LoadDBCStores(const std::string& dataPath) } LoadDBC(availableDbcLocales,bar,bad_dbc_files,sFactionTemplateStore, dbcPath,"FactionTemplate.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGameObjectDisplayInfoStore, dbcPath,"GameObjectDisplayInfo.dbc"); + for(uint32 i = 0; i < sGameObjectDisplayInfoStore.GetNumRows(); ++i) + { + if(GameObjectDisplayInfoEntry const * info = sGameObjectDisplayInfoStore.LookupEntry(i)) + { + if(info->maxX < info->minX) + std::swap(*(float*)(&info->maxX), *(float*)(&info->minX)); + if(info->maxY < info->minY) + std::swap(*(float*)(&info->maxY), *(float*)(&info->minY)); + if(info->maxZ < info->minZ) + std::swap(*(float*)(&info->maxZ), *(float*)(&info->minZ)); + } + } + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGemPropertiesStore, dbcPath,"GemProperties.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGlyphPropertiesStore, dbcPath,"GlyphProperties.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGlyphSlotStore, dbcPath,"GlyphSlot.dbc"); diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h index 4d7a9324ea2..5952d12ec71 100644 --- a/src/game/DBCStores.h +++ b/src/game/DBCStores.h @@ -84,6 +84,7 @@ extern DBCStorage sEmotesStore; extern DBCStorage sEmotesTextStore; extern DBCStorage sFactionStore; extern DBCStorage sFactionTemplateStore; +extern DBCStorage sGameObjectDisplayInfoStore; extern DBCStorage sGemPropertiesStore; extern DBCStorage sGlyphPropertiesStore; extern DBCStorage sGlyphSlotStore; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index d5078e8b408..ac5b2bf419f 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -837,6 +837,20 @@ struct FactionTemplateEntry bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD)!=0; } }; +struct GameObjectDisplayInfoEntry +{ + uint32 ID; //0 + //char* mdx; //1 + //uint32 unk1[10]; //2-11 + float minX; + float minY; + float minZ; + float maxX; + float maxY; + float maxZ; + //uint32 transport; //18 +}; + struct GemPropertiesEntry { uint32 ID; diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index e7980c31a27..734cad30d11 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -48,6 +48,7 @@ const char EmotesEntryfmt[]="nxxiiix"; const char EmotesTextEntryfmt[]="nxixxxxxxxxxxxxxxxx"; const char FactionEntryfmt[]="niiiiiiiiiiiiiiiiiissssssssssssssssxxxxxxxxxxxxxxxxxx"; const char FactionTemplateEntryfmt[]="niiiiiiiiiiiii"; +const char GameObjectDisplayInfofmt[]="nxxxxxxxxxxxffffffx"; const char GemPropertiesEntryfmt[]="nixxi"; const char GlyphPropertiesfmt[]="niii"; const char GlyphSlotfmt[]="nii"; -- cgit v1.2.3