From e846d4c3ef04d75839325409df109156d8ccced0 Mon Sep 17 00:00:00 2001 From: Wyrserth <43747507+Wyrserth@users.noreply.github.com> Date: Sun, 16 Jun 2019 20:00:57 +0200 Subject: Core/SAI: don't allow to start a new SAI actionlist while the entity is already running one. (#23421) (cherry picked from commit 2b1cde25604b6400ac327801d8e1649e30688f5a) --- src/server/game/AI/SmartScripts/SmartScript.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/server/game/AI/SmartScripts') diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index ddaab3492e0..06d28bad846 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -4143,6 +4143,10 @@ void SmartScript::SetTimedActionList(SmartScriptHolder& e, uint32 entry, Unit* i return; } + // Do NOT allow to start a new actionlist if a previous one is already running. We need to always finish the current actionlist + if (!mTimedActionList.empty()) + return; + mTimedActionList.clear(); mTimedActionList = sSmartScriptMgr->GetScript(entry, SMART_SCRIPT_TYPE_TIMED_ACTIONLIST); if (mTimedActionList.empty()) -- cgit v1.2.3