Core/AI: prevent triggering Alert (stealth pre-detection system) for Player immuned units

(cherry picked from commit eccb8857f1cbb480f3acef6fd16c99d607399974)
This commit is contained in:
ccrs
2026-06-30 19:16:20 +02:00
committed by Shauren
parent 70441309ca
commit cfcc93a076
+2 -2
View File
@@ -148,8 +148,8 @@ void CreatureAI::TriggerAlert(Unit const* who) const
if (me->GetTypeId() != TYPEID_UNIT || me->IsEngaged() || me->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING | UNIT_STATE_DISTRACTED))
return;
// Only alert for hostiles!
if (me->IsCivilian() || me->HasReactState(REACT_PASSIVE) || !me->IsHostileTo(who) || !me->_IsTargetAcceptable(who))
// Only alert for hostiles that can actually engage the target.
if (me->IsCivilian() || me->HasReactState(REACT_PASSIVE) || me->IsImmuneToPC() || !me->IsHostileTo(who) || !me->_IsTargetAcceptable(who))
return;
// Send alert sound (if any) for this creature