fix(Core/Quest): Fixed implementation of CONFIG_QUEST_IGNORE_AUTO_ACCEPT and CONFIG_QUEST_IGNORE_AUTO_COMPLETE configs. (#13525)

Fixes #3503
This commit is contained in:
UltraNix
2022-10-29 12:11:50 +02:00
committed by GitHub
parent ab9c648504
commit bcd9ad5066

View File

@@ -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<uint32>();
SpecialFlags = fields[17].Get<uint8>();
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