From dc0c6e0498c98af3b1d1e48e4afdca5e39634403 Mon Sep 17 00:00:00 2001 From: Tony Konzel Date: Sun, 18 Sep 2022 22:07:32 -0500 Subject: [PATCH] fix(Core): Creatures should finish casting any current spells before fleeing (#12964) --- src/server/game/AI/SmartScripts/SmartScript.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 58f1f33a4..69da11bac 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -4059,6 +4059,13 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) } } + // Delay flee for assist event if casting + if (e.GetActionType() == SMART_ACTION_FLEE_FOR_ASSIST && me && me->HasUnitState(UNIT_STATE_CASTING)) + { + e.timer = 1; + return; + } + e.active = true;//activate events with cooldown switch (e.GetEventType())//process ONLY timed events {