From cad89e8452d0236ad3124c7c88c2bb3dcae042e6 Mon Sep 17 00:00:00 2001 From: Miran Date: Sun, 24 Nov 2024 00:01:20 +0100 Subject: [PATCH] Keep main script in to be executed before custom scripts. --- source/CScriptEngine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/CScriptEngine.cpp b/source/CScriptEngine.cpp index 7e3d4258..69108dba 100644 --- a/source/CScriptEngine.cpp +++ b/source/CScriptEngine.cpp @@ -941,7 +941,13 @@ namespace CLEO GetInstance().ModuleSystem.LoadCleoModules(); LoadState(GetInstance().saveSlot); + + // keep main script as first to be exected + CRunningScript* main = *activeThreadQueue; + RemoveScriptFromQueue(main, activeThreadQueue); + LoadCustomScripts(); + AddScriptToQueue(main, activeThreadQueue); } void CScriptEngine::GameEnd()