From 9579fcfe64f60e41b959dd017a4874e0d054f88d Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sun, 17 Jan 2021 11:22:53 +0200 Subject: [PATCH] Mark the script as executed before invoking the callbacks. --- module/Core.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/Core.cpp b/module/Core.cpp index d292ab3c..4373aa04 100644 --- a/module/Core.cpp +++ b/module/Core.cpp @@ -430,6 +430,9 @@ bool Core::Execute() // Force enable null entities if not already enabled by script EnableNullEntities(); + // At this point, the scripts were executed + m_Executed = true; + m_LockPreLoadSignal = true; // Trigger callbacks that must initialize stuff before the loaded event is triggered (*mOnPreLoad.first)(); @@ -453,8 +456,9 @@ bool Core::Execute() ImportObjects(); ImportPickups(); ImportVehicles(); + // Successfully executed - return (m_Executed = true); + return m_Executed; } // ------------------------------------------------------------------------------------------------