From bcd9ad5066a86402aa5c917cd6d2ed227a33709e Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 29 Oct 2022 12:11:50 +0200 Subject: [PATCH] fix(Core/Quest): Fixed implementation of `CONFIG_QUEST_IGNORE_AUTO_ACCEPT` and `CONFIG_QUEST_IGNORE_AUTO_COMPLETE` configs. (#13525) Fixes #3503 --- src/server/game/Quests/QuestDef.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index e28a7c437..d14ddb3c3 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -131,6 +131,16 @@ Quest::Quest(Field* questRecord) } _eventIdForQuest = 0; + + if (sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_ACCEPT)) + { + Flags &= ~QUEST_FLAGS_AUTO_ACCEPT; + } + + if (sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE)) + { + Flags &= ~QUEST_FLAGS_AUTOCOMPLETE; + } } void Quest::LoadQuestDetails(Field* fields) @@ -180,8 +190,10 @@ void Quest::LoadQuestTemplateAddon(Field* fields) RewardMailSenderEntry = fields[16].Get(); SpecialFlags = fields[17].Get(); - if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT) + if ((SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT) && !sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_ACCEPT)) + { Flags |= QUEST_FLAGS_AUTO_ACCEPT; + } } uint32 Quest::XPValue(uint8 playerLevel) const @@ -253,12 +265,12 @@ uint32 Quest::GetRewMoneyMaxLevel() const bool Quest::IsAutoAccept() const { - return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_ACCEPT) ? false : (Flags & QUEST_FLAGS_AUTO_ACCEPT); + return HasFlag(QUEST_FLAGS_AUTO_ACCEPT); } bool Quest::IsAutoComplete() const { - return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE) ? false : HasFlag(QUEST_FLAGS_AUTOCOMPLETE); + return HasFlag(QUEST_FLAGS_AUTOCOMPLETE); } bool Quest::IsRaidQuest(Difficulty difficulty) const