diff options
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 20 |
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; -} |