aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2019-06-22 22:21:09 +0200
committerTreeston <treeston.mmoc@gmail.com>2019-06-22 22:21:09 +0200
commitc06330acf2b307604c97bdd7ad5dfd34b97bbf23 (patch)
tree184aebeb2e8cb5bc1a14cea2e4ab3d93c1749a51 /src/server/game/AI/CreatureAI.cpp
parenteeced9ae158640de67ed0cb59d01ae92570bfa77 (diff)
Revert "Core/AI: Fix Guardians not following the owner after finishing combat (#23466)"
This reverts commit c234604e82f291752f9095babe60e1780fd07569.
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r--src/server/game/AI/CreatureAI.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 47b0ba40812..1a468a4e8a1 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -36,9 +36,7 @@
AISpellInfoType* UnitAI::AISpellInfo;
AISpellInfoType* GetAISpellInfo(uint32 i) { return &UnitAI::AISpellInfo[i]; }
-CreatureAI::CreatureAI(Creature* creature)
- : UnitAI(creature), me(creature), _boundary(nullptr), _negateBoundary(false), _moveInLOSLocked(false),
- _wasEngaged(false)
+CreatureAI::CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), _negateBoundary(false), _moveInLOSLocked(false)
{
}
@@ -155,9 +153,6 @@ void CreatureAI::TriggerAlert(Unit const* who) const
void CreatureAI::EnterEvadeMode(EvadeReason why)
{
- // Set the WasEngaged flag to false to ensure we don't evade twice
- SetWasEngaged(false);
-
if (!_EnterEvadeMode(why))
return;
@@ -184,11 +179,7 @@ void CreatureAI::EnterEvadeMode(EvadeReason why)
bool CreatureAI::UpdateVictim()
{
- bool wasEngaged = SetWasEngaged(me->IsEngaged());
-
- // Don't skip the checks below if we were engaged in the tick before and are not engaged anymore now
- // (and we didn't evade yet. Notice that EnterEvadeMode() calls SetWasEngaged(false) )
- if (!wasEngaged && !me->IsEngaged())
+ if (!me->IsEngaged())
return false;
if (!me->HasReactState(REACT_PASSIVE))
@@ -366,10 +357,3 @@ Creature* CreatureAI::DoSummonFlyer(uint32 entry, WorldObject* obj, float flight
pos.m_positionZ += flightZ;
return me->SummonCreature(entry, pos, summonType, despawnTime);
}
-
-bool CreatureAI::SetWasEngaged(bool value)
-{
- bool previousValue = _wasEngaged;
- _wasEngaged = value;
- return previousValue;
-}