From f096c2089fd488a8d110d96e99332d50898b0110 Mon Sep 17 00:00:00 2001 From: Revision Date: Fri, 6 Dec 2024 08:45:41 +0100 Subject: [PATCH] Add a config option for dropping obsolete quests (#745) --- conf/playerbots.conf.dist | 4 ++++ src/PlayerbotAIConfig.cpp | 1 + src/PlayerbotAIConfig.h | 1 + src/strategy/actions/DropQuestAction.cpp | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 182a8cec2..bc7510aad 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -368,6 +368,10 @@ AiPlayerbot.SyncQuestWithPlayer = 1 # Default: 0 (disabled) AiPlayerbot.SyncQuestForPlayer = 0 +# Bots will drop obsolete quests +# Default: 1 (enabled) +AiPlayerbot.DropObsoleteQuests = 1 + # # # diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 0688c6b2a..48ff9b63e 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -494,6 +494,7 @@ bool PlayerbotAIConfig::Initialize() twoRoundsGearInit = sConfigMgr->GetOption("AiPlayerbot.TwoRoundsGearInit", false); syncQuestWithPlayer = sConfigMgr->GetOption("AiPlayerbot.SyncQuestWithPlayer", true); syncQuestForPlayer = sConfigMgr->GetOption("AiPlayerbot.SyncQuestForPlayer", false); + dropObsoleteQuests = sConfigMgr->GetOption("AiPlayerbot.DropObsoleteQuests", true); autoTrainSpells = sConfigMgr->GetOption("AiPlayerbot.AutoTrainSpells", "yes"); autoPickTalents = sConfigMgr->GetOption("AiPlayerbot.AutoPickTalents", true); autoUpgradeEquip = sConfigMgr->GetOption("AiPlayerbot.AutoUpgradeEquip", false); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index b2687fe82..714b70732 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -276,6 +276,7 @@ class PlayerbotAIConfig bool twoRoundsGearInit; bool syncQuestWithPlayer; bool syncQuestForPlayer; + bool dropObsoleteQuests; std::string autoTrainSpells; bool autoPickTalents; bool autoUpgradeEquip; diff --git a/src/strategy/actions/DropQuestAction.cpp b/src/strategy/actions/DropQuestAction.cpp index ffdbb942e..eea9337ff 100644 --- a/src/strategy/actions/DropQuestAction.cpp +++ b/src/strategy/actions/DropQuestAction.cpp @@ -68,6 +68,11 @@ bool CleanQuestLogAction::Execute(Event event) return false; } + if (!sPlayerbotAIConfig->dropObsoleteQuests) + { + return false; + } + // Only output this message if "debug rpg" strategy is enabled if (botAI->HasStrategy("debug rpg", BotState::BOT_STATE_COMBAT)) {