mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-13 23:33:47 +00:00
Rogue bots can unlock items in their bags and in the trade window (#1055)
This commit is contained in:
@@ -24,12 +24,17 @@ bool TradeStatusAction::Execute(Event event)
|
||||
return false;
|
||||
|
||||
PlayerbotAI* traderBotAI = GET_PLAYERBOT_AI(trader);
|
||||
if (trader != master && !traderBotAI)
|
||||
|
||||
// Allow the master and group members to trade
|
||||
if (trader != master && !traderBotAI && (!bot->GetGroup() || !bot->GetGroup()->IsMember(trader->GetGUID())))
|
||||
{
|
||||
bot->Whisper("I'm kind of busy now", LANG_UNIVERSAL, trader);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((trader != master || !botAI->GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, true, master)) &&
|
||||
// Allow trades from group members or bots
|
||||
if ((!bot->GetGroup() || !bot->GetGroup()->IsMember(trader->GetGUID())) &&
|
||||
(trader != master || !botAI->GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, true, master)) &&
|
||||
!traderBotAI)
|
||||
{
|
||||
WorldPacket p;
|
||||
@@ -109,9 +114,9 @@ bool TradeStatusAction::Execute(Event event)
|
||||
bot->SetFacingToObject(trader);
|
||||
|
||||
BeginTrade();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user