Handle command and trade check for summoned bot

This commit is contained in:
Yunfan Li
2024-08-07 17:45:21 +08:00
parent c0836c26e6
commit e88a93d65e
4 changed files with 26 additions and 26 deletions

View File

@@ -10,8 +10,10 @@
#include "GuildTaskMgr.h"
#include "ItemUsageValue.h"
#include "ItemVisitors.h"
#include "PlayerbotMgr.h"
#include "PlayerbotSecurity.h"
#include "Playerbots.h"
#include "RandomPlayerbotMgr.h"
#include "SetCraftAction.h"
bool TradeStatusAction::Execute(Event event)
@@ -180,8 +182,12 @@ bool TradeStatusAction::CheckTrade()
}
return isGettingItem;
}
if (!sRandomPlayerbotMgr->IsRandomBot(bot))
if (!bot->GetSession())
{
return false;
}
uint32 accountId = bot->GetSession()->GetAccountId();
if (!sPlayerbotAIConfig->IsInRandomAccountList(accountId))
{
int32 botItemsMoney = CalculateCost(bot, true);
int32 botMoney = bot->GetTradeData()->GetMoney() + botItemsMoney;