From f51d13ee7cd031c08c900987e6c51bf0a7491cc9 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Sun, 26 Jan 2025 21:09:06 -0600 Subject: [PATCH] Add bot check to IsAttackAllowed for GetUltimateOwner to skip entity list where possible --- zone/aggro.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index a2c439fdb..3c4bfd0e6 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -745,8 +745,8 @@ bool Mob::IsAttackAllowed(Mob *target, bool isSpellAttack) // can't damage own pet (applies to everthing) Mob *target_owner = target->GetOwner(); Mob *our_owner = GetOwner(); - Mob* target_ultimate_owner = target->GetUltimateOwner(); - Mob* our_ultimate_owner = GetUltimateOwner(); + Mob* target_ultimate_owner = (target->IsBot() ? target->CastToBot()->GetBotOwner() : target->GetUltimateOwner()); + Mob* our_ultimate_owner = (IsBot() ? CastToBot()->GetBotOwner() : GetUltimateOwner()); if (target_owner && target_owner == this) { return false;