Core/ObjectMgr: Refactor sPageTextStore
This commit is contained in:
@@ -48,7 +48,6 @@ extern SQLStorage sCreatureDataAddonStorage;
|
||||
extern SQLStorage sCreatureInfoAddonStorage;
|
||||
extern SQLStorage sEquipmentStorage;
|
||||
extern SQLStorage sGOStorage;
|
||||
extern SQLStorage sPageTextStore;
|
||||
extern SQLStorage sItemStorage;
|
||||
extern SQLStorage sInstanceTemplate;
|
||||
|
||||
@@ -57,6 +56,29 @@ class Guild;
|
||||
class ArenaTeam;
|
||||
class Item;
|
||||
|
||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack(1)
|
||||
#else
|
||||
#pragma pack(push,1)
|
||||
#endif
|
||||
|
||||
struct PageText
|
||||
{
|
||||
std::string Text;
|
||||
uint16 NextPage;
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack()
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
// Faster (insert/find) than UNORDERED_MAP in this case
|
||||
typedef std::map<uint32, PageText> PageTextContainer;
|
||||
|
||||
struct GameTele
|
||||
{
|
||||
float position_x;
|
||||
@@ -943,6 +965,7 @@ class ObjectMgr
|
||||
void LoadGameObjectForQuests();
|
||||
|
||||
void LoadPageTexts();
|
||||
PageText const* GetPageText(uint32 pageEntry);
|
||||
|
||||
void LoadPlayerInfo();
|
||||
void LoadPetLevelInfo();
|
||||
@@ -1343,6 +1366,8 @@ class ObjectMgr
|
||||
|
||||
LocaleConstant DBCLocaleIndex;
|
||||
|
||||
PageTextContainer PageTextStore;
|
||||
|
||||
private:
|
||||
void LoadScripts(ScriptsType type);
|
||||
void CheckScripts(ScriptsType type, std::set<int32>& ids);
|
||||
|
||||
Reference in New Issue
Block a user