From b9b688581b02bb4c091d0918f173d3e5ef8ca025 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Mon, 23 May 2016 03:54:50 +0300 Subject: [PATCH] Move routine processing outside the core class. --- source/CoreEvents.cpp | 6 ------ source/Main.cpp | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/source/CoreEvents.cpp b/source/CoreEvents.cpp index 7456a5ce..65c0ba14 100644 --- a/source/CoreEvents.cpp +++ b/source/CoreEvents.cpp @@ -8,9 +8,6 @@ // ------------------------------------------------------------------------------------------------ namespace SqMod { -// ------------------------------------------------------------------------------------------------ -extern void ProcessRoutines(); - // ------------------------------------------------------------------------------------------------ void Core::EmitCustomEvent(Int32 group, Int32 header, Object & payload) { @@ -186,9 +183,6 @@ void Core::EmitServerShutdown() // ------------------------------------------------------------------------------------------------ void Core::EmitServerFrame(Float32 elapsed_time) { - // Update routines - ProcessRoutines(); - // Now forward the event Emit(mOnServerFrame, elapsed_time); } diff --git a/source/Main.cpp b/source/Main.cpp index 863eb370..3b179283 100644 --- a/source/Main.cpp +++ b/source/Main.cpp @@ -16,6 +16,7 @@ static Object g_ReloadPayload; // ------------------------------------------------------------------------------------------------ extern void InitExports(); +extern void ProcessRoutines(); /* ------------------------------------------------------------------------------------------------ * Perform a scripts reload at the end of the current event. @@ -178,9 +179,12 @@ static void OnServerFrame(float elapsed_time) // Attempt to forward the event try { + // Now forward the event Core::Get().EmitServerFrame(elapsed_time); } SQMOD_CATCH_EVENT_EXCEPTION(OnServerFrame) + // Process routines, if any + ProcessRoutines(); // See if a reload was requested SQMOD_RELOAD_CHECK(false) }