From 471002f23332d51599d5047a43811cefac97d91d Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 11 Jan 2016 22:21:41 -0300 Subject: [PATCH] Partial cherry-pick 653954c14d6136295691e18d7e21918d46d0761f to fix build Core/Misc: - Update LocaleConstant enum - Update Quest locale system for WoD - Fix some rnd typo in quest template Conflicts: src/server/game/Chat/ChatLink.cpp src/server/game/Entities/Creature/GossipDef.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Globals/ObjectMgr.h src/server/game/Quests/QuestDef.cpp src/server/game/Quests/QuestDef.h src/server/game/Server/Packets/QuestPackets.cpp src/server/game/World/World.cpp src/server/scripts/Commands/cs_reload.cpp src/server/shared/Common.cpp src/server/shared/Common.h --- src/common/Common.cpp | 7 ++++--- src/common/Common.h | 3 ++- src/server/game/Globals/ObjectMgr.cpp | 16 ++++++++-------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/common/Common.cpp b/src/common/Common.cpp index 308da60257..0974bf38a4 100644 --- a/src/common/Common.cpp +++ b/src/common/Common.cpp @@ -27,15 +27,16 @@ char const* localeNames[TOTAL_LOCALES] = { "zhTW", "esES", "esMX", - "ruRU" + "ruRU", + "none", + "ptBR" }; LocaleConstant GetLocaleByName(const std::string& name) { for (uint32 i = 0; i < TOTAL_LOCALES; ++i) - if (name==localeNames[i]) + if (name == localeNames[i]) return LocaleConstant(i); return LOCALE_enUS; // including enGB case } - diff --git a/src/common/Common.h b/src/common/Common.h index f2483d2ea6..8583ad8435 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -125,9 +125,10 @@ enum LocaleConstant TOTAL_LOCALES }; +const uint8 OLD_TOTAL_LOCALES = 9; /// @todo convert in simple system #define DEFAULT_LOCALE LOCALE_enUS -#define MAX_LOCALES 8 +#define MAX_LOCALES 10 #define MAX_ACCOUNT_TUTORIAL_VALUES 8 extern char const* localeNames[TOTAL_LOCALES]; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 1bcd1787f2..97448392ff 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -334,7 +334,7 @@ void ObjectMgr::LoadCreatureLocales() CreatureLocale& data = _creatureLocaleStore[entry]; - for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i) + for (uint8 i = OLD_TOTAL_LOCALES - 1; i > 0; --i) { LocaleConstant locale = (LocaleConstant) i; AddLocaleString(fields[1 + 3 * (i - 1)].GetString(), locale, data.Name); @@ -371,7 +371,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() GossipMenuItemsLocale& data = _gossipMenuItemsLocaleStore[MAKE_PAIR32(menuId, id)]; - for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i) + for (uint8 i = OLD_TOTAL_LOCALES - 1; i > 0; --i) { LocaleConstant locale = (LocaleConstant) i; AddLocaleString(fields[2 + 2 * (i - 1)].GetString(), locale, data.OptionText); @@ -402,7 +402,7 @@ void ObjectMgr::LoadPointOfInterestLocales() PointOfInterestLocale& data = _pointOfInterestLocaleStore[entry]; - for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i) + for (uint8 i = OLD_TOTAL_LOCALES - 1; i > 0; --i) AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.IconName); } while (result->NextRow()); @@ -4704,7 +4704,7 @@ void ObjectMgr::LoadQuestLocales() QuestLocale& data = _questLocaleStore[entry]; - for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i) + for (uint8 i = OLD_TOTAL_LOCALES - 1; i > 0; --i) { LocaleConstant locale = (LocaleConstant) i; @@ -5331,7 +5331,7 @@ void ObjectMgr::LoadPageTextLocales() PageTextLocale& data = _pageTextLocaleStore[entry]; - for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i) + for (uint8 i = OLD_TOTAL_LOCALES - 1; i > 0; --i) AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Text); } while (result->NextRow()); @@ -5594,7 +5594,7 @@ void ObjectMgr::LoadNpcTextLocales() NpcTextLocale& data = _npcTextLocaleStore[entry]; - for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i) + for (uint8 i = OLD_TOTAL_LOCALES - 1; i > 0; --i) { LocaleConstant locale = (LocaleConstant) i; for (uint8 j = 0; j < MAX_GOSSIP_TEXT_OPTIONS; ++j) @@ -7815,7 +7815,7 @@ bool ObjectMgr::LoadTrinityStrings() data.Content.resize(DEFAULT_LOCALE + 1); - for (int8 i = TOTAL_LOCALES - 1; i >= 0; --i) + for (int8 i = OLD_TOTAL_LOCALES - 1; i >= 0; --i) AddLocaleString(fields[i + 1].GetString(), LocaleConstant(i), data.Content); } while (result->NextRow()); @@ -8813,7 +8813,7 @@ void ObjectMgr::LoadBroadcastTextLocales() continue; } - for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i) + for (uint8 i = OLD_TOTAL_LOCALES - 1; i > 0; --i) { LocaleConstant locale = LocaleConstant(i); AddLocaleString(fields[1 + (i - 1)].GetString(), locale, bct->second.MaleText);