Added configuration on excluded prefixes for trade action (#1401)

* - Added configuration on excluded prefixes for trade action

* - LoadListString usage reference specified

* - Code refactoring
This commit is contained in:
kadeshar
2025-07-04 17:13:19 +02:00
committed by GitHub
parent 40535f6e55
commit c0aa55416b
4 changed files with 7 additions and 7 deletions

View File

@@ -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<std::string> 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;