From d339fdc354071c26601dde070e229909893daa3d 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: [PATCH] Core/SAI: don't allow to start a new SAI actionlist while the entity is already running one. (#23421) --- src/server/game/AI/SmartScripts/SmartScript.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 0afee1b82b9..d0892be7507 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3861,6 +3861,10 @@ void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry) 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())