[Bot behaviour] accept invitation teleport distance check

This commit is contained in:
Yunfan Li
2024-06-22 18:37:48 +08:00
parent 01eb0e6434
commit 5318e4b49d

View File

@@ -4,6 +4,7 @@
#include "AcceptInvitationAction.h"
#include "Event.h"
#include "PlayerbotAIConfig.h"
#include "Playerbots.h"
#include "PlayerbotSecurity.h"
@@ -42,7 +43,7 @@ bool AcceptInvitationAction::Execute(Event event)
botAI->TellMaster("Hello");
if (sPlayerbotAIConfig->summonWhenGroup) {
if (sPlayerbotAIConfig->summonWhenGroup && bot->GetDistance(inviter) > sPlayerbotAIConfig->sightDistance) {
Teleport(inviter, bot);
}
return true;