Skip to content

Commit

Permalink
refactor: organise
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisAMJ committed Oct 26, 2024
1 parent 47a4b7e commit 98153c6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Features/RNGManip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#include <cstring>
#include <deque>
#include <fstream>
#include <set>
#include <sstream>
#include <string>
#include <set>

static std::optional<json11::Json> g_session_state;
static std::optional<json11::Json> g_pending_load;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 98153c6

Please sign in to comment.