From efe999309a4a0bb1716c54c2393974352d76c0ad Mon Sep 17 00:00:00 2001 From: schell244 Date: Sat, 20 Nov 2021 10:38:08 +0100 Subject: [PATCH] fix(Core/CreatureAI): enemy stealth alert ignoring LOS (#9161) --- src/server/game/AI/CreatureAI.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 8ad8ab245..6aed4ea32 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -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