diff options
| author | treeston <treeston.mmoc@gmail.com> | 2016-02-20 03:13:11 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-04-08 18:43:03 +0200 |
| commit | b2e4a962d9bc5105847f8ae0668e77b6a9961335 (patch) | |
| tree | b89cf48e84ddcd7080e09822f097ac1b4d229583 /src | |
| parent | aca9efc47ac01ef803288dbb55207726a57f4bd6 (diff) | |
Incorrect AI aggression as a consequence of the LineOfSight change, episode three, revenge of the special AIs. Also, hopefully the last. No original trilogy please.
(cherry picked from commit ab194d5ae3b9812ebd5c8f56559e85f1441cf857)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 6e8a2def3e3..0c477bef586 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -105,7 +105,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who) void npc_escortAI::MoveInLineOfSight(Unit* who) { - if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) + if (me->HasReactState(REACT_AGGRESSIVE) && !me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) { if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who)) return; diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 583e99b9d10..2fa34a8716a 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -102,7 +102,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who) void FollowerAI::MoveInLineOfSight(Unit* who) { - if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) + if (me->HasReactState(REACT_AGGRESSIVE) && !me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) { if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who)) return; diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 2dec1d0fc4c..2f91b593a57 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -466,6 +466,9 @@ bool SmartAI::CanAIAttack(const Unit* /*who*/) const bool SmartAI::AssistPlayerInCombat(Unit* who) { + if (me->HasReactState(REACT_PASSIVE)) + return; + if (!who || !who->GetVictim()) return false; |
