mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-04 08:17:48 +00:00
fix(Core/Threat): Melee creatures should only target units they can attack when rooted (#24526)
This commit is contained in:
@@ -468,6 +468,9 @@ bool ThreatContainer::IsPreferredTarget(Creature* attacker, Unit* target) const
|
||||
if (target->HasAuraTypeWithCaster(SPELL_AURA_IGNORED, attacker->GetGUID()))
|
||||
return false;
|
||||
|
||||
if (attacker->HasUnitState(UNIT_STATE_ROOT) && attacker->IsCombatMovementAllowed() && !attacker->IsWithinMeleeRange(target))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user