From 1f90e4e339eb60942cc0f682c7389ab74282b22b Mon Sep 17 00:00:00 2001 From: Jesse <69196954+ThisAMJ@users.noreply.github.com> Date: Sat, 31 Aug 2024 19:49:15 +1000 Subject: [PATCH] refactor: organise --- src/Features/RNGManip.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Features/RNGManip.cpp b/src/Features/RNGManip.cpp index 6b92f87c..aa6f11b9 100644 --- a/src/Features/RNGManip.cpp +++ b/src/Features/RNGManip.cpp @@ -15,9 +15,9 @@ #include #include #include +#include #include #include -#include static std::optional g_session_state; static std::optional g_pending_load; @@ -589,13 +589,6 @@ void RngManip::ExitProcessMovement(CMoveData *move) { playerTrace->ExitLogScope(); } -ON_EVENT(SESSION_START) { - // Reset this between sessions so the stuck check can't depend on previous sessions - if (!g_gamemovement) return; - float *m_flStuckCheckTime = (float *)(((char *)g_gamemovement) + 36 + 33*3*16 + 8); - memset(m_flStuckCheckTime, 0, 34 * 2 * sizeof (float)); -} - extern Hook g_Friction_Hook; DECL_DETOUR_T(void, Friction) { playerTrace->EnterLogScope("CPortalGameMovement::Friction"); @@ -720,6 +713,13 @@ ON_INIT { g_AirAccelerate_Hook.SetFunc(AirAccelerate); } +ON_EVENT(SESSION_START) { + // Reset this between sessions so the stuck check can't depend on previous sessions + if (!g_gamemovement) return; + float *m_flStuckCheckTime = (float *)(((char *)g_gamemovement) + 36 + 33*3*16 + 8); + memset(m_flStuckCheckTime, 0, 34 * 2 * sizeof (float)); +} + ON_EVENT(SESSION_END) { engine->ExecuteCommand("phys_timescale 1", true); //console->Print("physics rng state reset\n");