fix(Core/CreatureAI): enemy stealth alert ignoring LOS (#9161)

This commit is contained in:
schell244
2021-11-20 10:38:08 +01:00
committed by GitHub
parent e747716230
commit efe999309a

View File

@@ -186,6 +186,9 @@ void CreatureAI::TriggerAlert(Unit const* who) const
// Only alert for hostiles!
if (me->IsCivilian() || me->HasReactState(REACT_PASSIVE) || !me->IsHostileTo(who) || !me->_IsTargetAcceptable(who))
return;
// Only alert if target is within line of sight
if (!me->IsWithinLOSInMap(who))
return;
// Send alert sound (if any) for this creature
me->SendAIReaction(AI_REACTION_ALERT);
// Face the unit (stealthed player) and set distracted state for 5 seconds