diff options
author | Killyana <morphone1@gmail.com> | 2020-03-22 16:11:19 +0100 |
---|---|---|
committer | Killyana <morphone1@gmail.com> | 2020-03-22 16:11:19 +0100 |
commit | cc0c56ceae69cab3133e3efc8173b4fd857852da (patch) | |
tree | 4a925ede529668e56f43f41a348d190e1f49e8f6 /src | |
parent | b166d12cbef07a72828d8d20a2130926a5cae47e (diff) |
Core/AI: Fix reset and interruption of non melee spells
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 7 | ||||
-rw-r--r-- | src/server/game/AI/CreatureAI.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index e028665e843..9fb915a436a 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -205,6 +205,11 @@ void CreatureAI::JustAppeared() } } +void CreatureAI::JustReachedHome() +{ + Reset(); +} + void CreatureAI::JustEnteredCombat(Unit* who) { if (!IsEngaged() && !me->CanHaveThreatList()) @@ -234,7 +239,6 @@ void CreatureAI::EnterEvadeMode(EvadeReason why) } } - Reset(); } bool CreatureAI::UpdateVictim() @@ -276,6 +280,7 @@ void CreatureAI::EngagementStart(Unit* who) } _isEngaged = true; + me->InterruptNonMeleeSpells(false); me->AtEngage(who); } diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 0f9a7e5c817..00dbf33a33e 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -157,7 +157,7 @@ class TC_GAME_API CreatureAI : public UnitAI void OnCharmed(bool isNew) override; // Called at reaching home after evade - virtual void JustReachedHome() { } + virtual void JustReachedHome(); void DoZoneInCombat(Creature* creature = nullptr); |