From 79cd94d26df33a332586b2aa72a99b123199c88f Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 30 Jun 2020 00:22:25 +0200 Subject: Core/Misc: Changed GetLocaleByName to return invalid value on invalid input instead of LOCALE_enUS * Also added IsValidLocale helper function --- src/server/game/Texts/CreatureTextMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/game/Texts') diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 78e96e12492..30f578aa872 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -197,7 +197,7 @@ void CreatureTextMgr::LoadCreatureTextLocales() std::string localeName = fields[3].GetString(); LocaleConstant locale = GetLocaleByName(localeName); - if (locale == LOCALE_enUS) + if (!IsValidLocale(locale) || locale == LOCALE_enUS) continue; CreatureTextLocale& data = mLocaleTextMap[CreatureTextId(creatureId, groupId, id)]; -- cgit v1.2.3