diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-06-30 00:22:25 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-06-30 00:22:25 +0200 |
commit | 79cd94d26df33a332586b2aa72a99b123199c88f (patch) | |
tree | dba4de419d8c470b4f932702d0ba71da569c9e03 /src/server/game/Globals/ObjectMgr.cpp | |
parent | 40c71ea9fca547f2a6fd547cb1cd35af361c4f3c (diff) |
Core/Misc: Changed GetLocaleByName to return invalid value on invalid input instead of LOCALE_enUS
* Also added IsValidLocale helper function
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2fb6dfa2f51..f0fc3f5e297 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -336,7 +336,7 @@ void ObjectMgr::LoadCreatureLocales() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; CreatureLocale& data = _creatureLocaleStore[id]; @@ -371,7 +371,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() std::string localeName = fields[2].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; GossipMenuItemsLocale& data = _gossipMenuItemsLocaleStore[std::make_pair(menuId, optionIndex)]; @@ -401,7 +401,7 @@ void ObjectMgr::LoadPointOfInterestLocales() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; PointOfInterestLocale& data = _pointOfInterestLocaleStore[id]; @@ -4758,7 +4758,7 @@ void ObjectMgr::LoadQuestTemplateLocale() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; QuestTemplateLocale& data = _questTemplateLocaleStore[id]; @@ -4794,7 +4794,7 @@ void ObjectMgr::LoadQuestObjectivesLocale() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; QuestObjectivesLocale& data = _questObjectivesLocaleStore[id]; @@ -4847,7 +4847,7 @@ void ObjectMgr::LoadQuestGreetingLocales() std::string localeName = fields[2].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; QuestGreetingLocale& data = _questGreetingLocaleStore[type][id]; @@ -4877,7 +4877,7 @@ void ObjectMgr::LoadQuestOfferRewardLocale() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; QuestOfferRewardLocale& data = _questOfferRewardLocaleStore[id]; @@ -4905,7 +4905,7 @@ void ObjectMgr::LoadQuestRequestItemsLocale() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; QuestRequestItemsLocale& data = _questRequestItemsLocaleStore[id]; @@ -5545,7 +5545,7 @@ void ObjectMgr::LoadPageTextLocales() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; PageTextLocale& data = _pageTextLocaleStore[id]; @@ -6943,7 +6943,7 @@ void ObjectMgr::LoadGameObjectLocales() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; GameObjectLocale& data = _gameObjectLocaleStore[id]; @@ -8728,7 +8728,7 @@ void ObjectMgr::LoadTrainers() std::string localeName = fields[1].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; if (Trainer::Trainer* trainer = Trinity::Containers::MapGetValuePtr(_trainers, trainerId)) @@ -10477,7 +10477,7 @@ void ObjectMgr::LoadPlayerChoicesLocale() } LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; PlayerChoiceLocale& data = _playerChoiceLocales[choiceId]; @@ -10518,7 +10518,7 @@ void ObjectMgr::LoadPlayerChoicesLocale() } LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; PlayerChoiceResponseLocale& data = itr->second.Responses[responseId]; |