aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2016-02-11 18:33:00 +0100
committerShauren <shauren.trinity@gmail.com>2016-04-05 21:51:17 +0200
commit845f81daa5b5b16729483e213bda4b2de36073f8 (patch)
tree1ed88269ebb0bc4b12fb1f9f9ae310c8688e737a
parent9d48229cd1fba6c798fb4f598550c272e3214e1e (diff)
Core/AI: Fully move react state check from CreatureUnitRelocationWorker to CreatureAI::MoveInLineOfSight. This means that AI for passive/defensive creatures can now once again use MoveInLineOfSight (and fixes that weird thing where triggers decided it would be funny to attack players).
(cherry picked from commit 8e6fb3b1c50f62d95284cf0cc6c25819622e62f3)
-rw-r--r--src/server/game/AI/CreatureAI.cpp2
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 44098586e5f..352ae635878 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -133,7 +133,7 @@ void CreatureAI::MoveInLineOfSight(Unit* who)
if (me->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) // non-combat pets should just stand there and look good;)
return;
- if (me->CanStartAttack(who, false))
+ if (me->HasReactState(REACT_AGGRESSIVE) && me->CanStartAttack(who, false))
AttackStart(who);
//else if (who->GetVictim() && me->IsFriendlyTo(who)
// && me->IsWithinDistInMap(who, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
index c4a1af03c3d..a7201ea3744 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
@@ -131,7 +131,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
if (!u->IsAlive() || !c->IsAlive() || c == u || u->IsInFlight())
return;
- if ((c->HasReactState(REACT_AGGRESSIVE) || c->IsTrigger()) && !c->HasUnitState(UNIT_STATE_SIGHTLESS))
+ if (!c->HasUnitState(UNIT_STATE_SIGHTLESS))
{
if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
c->AI()->MoveInLineOfSight_Safe(u);