diff options
author | Antonio MartÃn Berti <15972392+BertiRean@users.noreply.github.com> | 2024-06-03 19:44:22 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 00:44:22 +0200 |
commit | 3fd967754388b7b859dbd8b954ec68a844e172f0 (patch) | |
tree | 447c456bc9cad7e35c54ae4c5de937a478a7beac /src/server/game/Quests | |
parent | 18fd59d965694b5cd0f62c011875a5d8beaac7e2 (diff) |
Core/Misc: Added Loading.Locales to enable/disable the load of locales (#30013)
Diffstat (limited to 'src/server/game/Quests')
-rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index a77b6f8d3b4..cfe33834173 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -309,6 +309,9 @@ void Quest::LoadQuestObjectiveVisualEffect(Field* fields) void Quest::LoadConditionalConditionalQuestDescription(Field* fields) { LocaleConstant locale = GetLocaleByName(fields[4].GetStringView()); + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && locale != DEFAULT_LOCALE) + return; + if (locale >= TOTAL_LOCALES) { TC_LOG_ERROR("sql.sql", "Table `quest_description_conditional` has invalid locale {} set for quest {}. Skipped.", fields[4].GetCString(), fields[0].GetUInt32()); @@ -329,6 +332,9 @@ void Quest::LoadConditionalConditionalQuestDescription(Field* fields) void Quest::LoadConditionalConditionalRequestItemsText(Field* fields) { LocaleConstant locale = GetLocaleByName(fields[4].GetStringView()); + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && locale != DEFAULT_LOCALE) + return; + if (locale >= TOTAL_LOCALES) { TC_LOG_ERROR("sql.sql", "Table `quest_request_items_conditional` has invalid locale {} set for quest {}. Skipped.", fields[4].GetCString(), fields[0].GetUInt32()); @@ -349,6 +355,9 @@ void Quest::LoadConditionalConditionalRequestItemsText(Field* fields) void Quest::LoadConditionalConditionalOfferRewardText(Field* fields) { LocaleConstant locale = GetLocaleByName(fields[4].GetStringView()); + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && locale != DEFAULT_LOCALE) + return; + if (locale >= TOTAL_LOCALES) { TC_LOG_ERROR("sql.sql", "Table `quest_offer_reward_conditional` has invalid locale {} set for quest {}. Skipped.", fields[4].GetCString(), fields[0].GetUInt32()); @@ -369,6 +378,9 @@ void Quest::LoadConditionalConditionalOfferRewardText(Field* fields) void Quest::LoadConditionalConditionalQuestCompletionLog(Field* fields) { LocaleConstant locale = GetLocaleByName(fields[4].GetStringView()); + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && locale != DEFAULT_LOCALE) + return; + if (locale >= TOTAL_LOCALES) { TC_LOG_ERROR("sql.sql", "Table `quest_completion_log_conditional` has invalid locale {} set for quest {}. Skipped.", fields[4].GetCString(), fields[0].GetUInt32()); @@ -604,7 +616,12 @@ bool Quest::CanIncreaseRewardedQuestCounters() const void Quest::InitializeQueryData() { for (uint8 loc = LOCALE_enUS; loc < TOTAL_LOCALES; ++loc) + { + if (!sWorld->getBoolConfig(CONFIG_LOAD_LOCALES) && loc != DEFAULT_LOCALE) + continue; + QueryData[loc] = BuildQueryData(static_cast<LocaleConstant>(loc), nullptr); + } } WorldPacket Quest::BuildQueryData(LocaleConstant loc, Player* player) const |