MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / ServerUpdateSlowMo_Hook

Function ServerUpdateSlowMo_Hook

src/Server/Server.cpp:35–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33// ========================
34
35void __fastcall ServerUpdateSlowMo_Hook(int* thisPtr, int)
36{
37 int hSlowMoRecord = *(int*)((char*)thisPtr + g_State.phSlowMoRecord);
38
39 // New activation, reset observation
40 if (hSlowMoRecord != g_State.lastHSlowMoRecord)
41 {
42 g_State.slowMoChargeObserved = false;
43 g_State.lastHSlowMoRecord = hSlowMoRecord;
44 }
45
46 // Latch: once we've seen a real charge, we trust future zero readings
47 if (g_State.clientSlowMoCharge > 0.01)
48 {
49 g_State.slowMoChargeObserved = true;
50 }
51
52 // Only force-exit if we've confirmed charge was real and it's now depleted
53 if (hSlowMoRecord != 0 && g_State.slowMoChargeObserved && g_State.clientSlowMoCharge <= 0.01)
54 {
55 ServerExitSlowMo(thisPtr, true, 0.0f);
56 return;
57 }
58 ServerUpdateSlowMo(thisPtr);
59}
60
61// ===============
62// Rumble

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected