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()))
|
if (target->HasAuraTypeWithCaster(SPELL_AURA_IGNORED, attacker->GetGUID()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (attacker->HasUnitState(UNIT_STATE_ROOT) && attacker->IsCombatMovementAllowed() && !attacker->IsWithinMeleeRange(target))
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -254,6 +254,7 @@ public:
|
|||||||
|
|
||||||
bool CanAIAttack(Unit const* victim) const override
|
bool CanAIAttack(Unit const* victim) const override
|
||||||
{
|
{
|
||||||
|
// Used for Magma Blast handling to force EnterEvadeMode if there are no melee targets
|
||||||
return me->IsWithinMeleeRange(victim);
|
return me->IsWithinMeleeRange(victim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,11 +85,6 @@ struct boss_murmur : public BossAI
|
|||||||
}, 3600ms, 10900ms, GROUP_OOC_CAST);
|
}, 3600ms, 10900ms, GROUP_OOC_CAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CanAIAttack(Unit const* victim) const override
|
|
||||||
{
|
|
||||||
return me->IsWithinMeleeRange(victim);
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnterEvadeMode(EvadeReason why) override
|
void EnterEvadeMode(EvadeReason why) override
|
||||||
{
|
{
|
||||||
if (me->GetThreatMgr().GetThreatList().empty())
|
if (me->GetThreatMgr().GetThreatList().empty())
|
||||||
|
|||||||
Reference in New Issue
Block a user