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");