diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-09-09 14:47:05 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-10-26 23:51:12 +0200 |
| commit | 26ca7b0fc2907f861d2cdbf1e8699b364518501b (patch) | |
| tree | 4a397494251b7aab4d11c290b275bd8ef67ca1b7 /src | |
| parent | 5bcfe93c2029a46ecb0c917bd7cd7d1ab6dabd0f (diff) | |
Core/Creature: Get rid of a few Creature::getAttackerForHelper misuses. That's not what the function does, folks.
(cherry picked from commit 71c5569d186c4c24382b7c2846630da4a9edfb4f)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 19cc3aab8b3..fa55c5c6134 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1978,11 +1978,6 @@ bool Creature::CanStartAttack(Unit const* who, bool force) const if (!_IsTargetAcceptable(who)) return false; - if (who->IsEngaged() && IsWithinDist(who, ATTACK_DISTANCE)) - if (Unit* victim = who->getAttackerForHelper()) - if (IsWithinDistInMap(victim, sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))) - force = true; - if (!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who) + m_CombatDistance))) return false; } @@ -2535,16 +2530,10 @@ bool Creature::_IsTargetAcceptable(Unit const* target) const return false; } - Unit const* 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 && IsFriendlyTo(targetVictim)) - return true; - // if the target's victim is not friendly, or the target is friendly, the target is not acceptable return false; } |
