diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 81a55883..5d810b40 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -588,6 +588,9 @@ AiPlayerbot.LimitTalentsExpansion = 0 # Default: 1 (enabled) AiPlayerbot.EnableRandomBotTrading = 1 +# Configure message prefixes which will be excluded in analysis in trade action to open trade window +AiPlayerbot.TradeActionExcludedPrefixes = "RPLL_H_,DBMv4,{звезда} Questie,{rt1} Questie" + # # # diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 3bfd25ba..09ca801c 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -4,9 +4,7 @@ */ #include "PlayerbotAIConfig.h" - #include - #include "Config.h" #include "PlayerbotDungeonSuggestionMgr.h" #include "PlayerbotFactory.h" @@ -465,6 +463,8 @@ bool PlayerbotAIConfig::Initialize() LoadListString>(sConfigMgr->GetOption("AiPlayerbot.AllowedLogFiles", ""), allowedLogFiles); + LoadListString>(sConfigMgr->GetOption("AiPlayerbot.TradeActionExcludedPrefixes", ""), + tradeActionExcludedPrefixes); worldBuffs.clear(); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index 82ce3594..721c75b5 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -255,6 +255,7 @@ public: uint32 iterationsPerTick; std::mutex m_logMtx; + std::vector tradeActionExcludedPrefixes; std::vector allowedLogFiles; std::unordered_map> logFiles; diff --git a/src/strategy/actions/TradeAction.cpp b/src/strategy/actions/TradeAction.cpp index c1388b66..62f8b513 100644 --- a/src/strategy/actions/TradeAction.cpp +++ b/src/strategy/actions/TradeAction.cpp @@ -4,7 +4,6 @@ */ #include "TradeAction.h" - #include "ChatHelper.h" #include "Event.h" #include "ItemCountValue.h" @@ -15,11 +14,8 @@ bool TradeAction::Execute(Event event) { std::string const text = event.getParam(); - // Table with prefixes to be excluded from analysis - static const std::vector excludedPrefixes = {"RPLL_H_"}; - // If text starts with any excluded prefix, don't process it further. - for (const auto& prefix : excludedPrefixes) + for (const auto& prefix : sPlayerbotAIConfig->tradeActionExcludedPrefixes) { if (text.find(prefix) == 0) return false;