Core/Misc: Changed GetLocaleByName to return invalid value on invalid input instead of LOCALE_enUS

Port From (https://github.com/TrinityCore/TrinityCore/commit/79cd94d26df33a332586b2aa72a99b123199c88f)
This commit is contained in:
hondacrx
2020-07-14 17:11:56 -04:00
parent e179d29b55
commit 4bb9823456
5 changed files with 21 additions and 16 deletions
+1 -1
View File
@@ -143,7 +143,7 @@ namespace Game
uint id = result.Read<byte>(2);
string localeName = result.Read<string>(3);
Locale locale = localeName.ToEnum<Locale>();
if (locale == Locale.enUS)
if (!SharedConst.IsValidLocale(locale) || locale == Locale.enUS)
continue;
var key = new CreatureTextId(creatureId, groupId, id);