Merge pull request #363 from noisiver/pvp-fix

Fix: Bots attacking players that are not flagged for PvP
This commit is contained in:
Revision 2024-07-22 00:23:06 +02:00 committed by GitHub
commit fedb6084e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -95,6 +95,16 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
return false; return false;
} }
if (target->IsPlayer() && !target->IsPvP() && !target->IsFFAPvP() && (!bot->duel || bot->duel->Opponent != target || bot->duel->StartTime))
{
if (verbose)
{
botAI->TellError(Acore::StringFormat("%s is not flagged for pvp", target->GetName()));
}
return false;
}
if (bot->IsMounted() && bot->IsWithinLOSInMap(target)) if (bot->IsMounted() && bot->IsWithinLOSInMap(target))
{ {
WorldPacket emptyPacket; WorldPacket emptyPacket;