Add bot check to IsAttackAllowed for GetUltimateOwner to skip entity list where possible

This commit is contained in:
nytmyr
2025-01-26 21:09:06 -06:00
parent 41b8cb3e71
commit f51d13ee7c
+2 -2
View File
@@ -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;