summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschell244 <Schell244@web.de>2021-11-20 10:38:08 +0100
committerGitHub <noreply@github.com>2021-11-20 10:38:08 +0100
commitefe999309a4a0bb1716c54c2393974352d76c0ad (patch)
tree369f89ddf4ccba9bfc4dcd3e08dc1051060603b0 /src
parente747716230ef6fddff10399bbef6e00ef7e87b52 (diff)
fix(Core/CreatureAI): enemy stealth alert ignoring LOS (#9161)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CreatureAI.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 8ad8ab2450..6aed4ea322 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