Improve check to work in custom defines zones as well (#797)

This commit is contained in:
SaW
2024-12-18 18:29:35 +01:00
committed by GitHub
parent 3dd92b7fd8
commit 570787ff16

View File

@@ -105,7 +105,8 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
return false;
}
if (!bot->IsValidAttackTarget(target) && sPlayerbotAIConfig->IsInPvpProhibitedZone(bot->GetZoneId()))
if (sPlayerbotAIConfig->IsInPvpProhibitedZone(bot->GetZoneId())
&& (target->IsPlayer() || target->IsPet() || !bot->IsValidAttackTarget(target)))
{
if (verbose)
botAI->TellError("I cannot attack others in PvP prohibited zones");