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) }