Core/Misc: Added Loading.Locales to enable/disable the load of locales

Port From (https://github.com/TrinityCore/TrinityCore/commit/3fd967754388b7b859dbd8b954ec68a844e172f0)
This commit is contained in:
Hondacrx
2024-08-25 21:03:45 -04:00
parent 9ad961e64a
commit c98e58a7e1
8 changed files with 76 additions and 22 deletions
+2 -5
View File
@@ -3257,10 +3257,7 @@ namespace Game
}
foreach (var unusedSpells in spellsByTrainer)
{
Log.outError(LogFilter.Sql, $"Table `trainer_spell` references non-existing trainer (TrainerId: {unusedSpells.Key}) for SpellId {unusedSpells.Value.SpellId}, ignoring");
}
Log.outError(LogFilter.Sql, $"Table `trainer_spell` references non-existing trainer (TrainerId: {unusedSpells.Key}) for SpellId {unusedSpells.Value.SpellId}, ignoring");
SQLResult trainerLocalesResult = DB.World.Query("SELECT Id, locale, Greeting_lang FROM trainer_locale");
if (!trainerLocalesResult.IsEmpty())
@@ -3271,7 +3268,7 @@ namespace Game
string localeName = trainerLocalesResult.Read<string>(1);
Locale locale = localeName.ToEnum<Locale>();
if (!SharedConst.IsValidLocale(locale) || locale == Locale.enUS)
if (!SharedConst.IsValidLocale(locale) || !WorldConfig.GetBoolValue(WorldCfg.LoadLocales) || locale == Locale.enUS)
continue;
Trainer trainer = trainers.LookupByKey(trainerId);