diff options
| author | Antonio MartÃn Berti <15972392+BertiRean@users.noreply.github.com> | 2024-06-03 19:44:22 -0300 |
|---|---|---|
| committer | Ovahlord <dreadkiller@gmx.de> | 2024-06-20 01:16:25 +0200 |
| commit | 2855d26c64ca7387ec04ac18398274008454d066 (patch) | |
| tree | 234c954e799f9dac56ce48a4053570f5b1a6afe7 /src/server/game/Quests/QuestDef.cpp | |
| parent | da1af58e029b9ec31c05561cc11c227ff2d992d8 (diff) | |
Core/Misc: Added Loading.Locales to enable/disable the load of locales (#30013)
(cherry picked from commit 3fd967754388b7b859dbd8b954ec68a844e172f0)
Diffstat (limited to 'src/server/game/Quests/QuestDef.cpp')
| -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 23403d6acc2..ed7ceb10b6b 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -312,6 +312,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()); @@ -332,6 +335,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()); @@ -352,6 +358,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()); @@ -372,6 +381,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()); @@ -598,7 +610,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 |
