From f4c1e8cbbe49858ddd86fd4aaf5dd32b4768138c Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 3 Nov 2021 11:49:08 -0400 Subject: [PATCH] Core/Creature: Get rid of a few Creature::getAttackerForHelper misuses. That's not what the function does, folks. Port From (https://github.com/TrinityCore/TrinityCore/commit/26ca7b0fc2907f861d2cdbf1e8699b364518501b) --- Source/Game/Entities/Creature/Creature.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index a09c3da7f..e854b3368 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -1694,14 +1694,6 @@ namespace Game.Entities if (!_IsTargetAcceptable(who)) return false; - if (who.IsEngaged() && IsWithinDist(who, SharedConst.AttackDistance)) - { - Unit victim = who.GetAttackerForHelper(); - if (victim != null) - if (IsWithinDistInMap(victim, WorldConfig.GetFloatValue(WorldCfg.CreatureFamilyAssistanceRadius))) - force = true; - } - if (!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who) + m_CombatDistance))) return false; } @@ -2232,16 +2224,10 @@ namespace Game.Entities return false; } - Unit targetVictim = target.GetAttackerForHelper(); - // if I'm already fighting target, or I'm hostile towards the target, the target is acceptable if (IsEngagedBy(target) || IsHostileTo(target)) return true; - // if the target's victim is friendly, and the target is neutral, the target is acceptable - if (targetVictim != null && IsFriendlyTo(targetVictim)) - return true; - // if the target's victim is not friendly, or the target is friendly, the target is not acceptable return false; }