fix timescale dvar

This commit is contained in:
Skull Merlin 2022-06-04 06:06:10 +03:00
parent 7edc6adfbe
commit 7830648689

View File

@ -248,24 +248,23 @@ namespace gameplay
utils::hook::jump(0x3FF812_b, client_end_frame_stub(), true);
utils::hook::nop(0x3FF808_b, 1);
/*
// Influence PM_JitterPoint code flow so the trace->startsolid checks are 'ignored'
/*// Influence PM_JitterPoint code flow so the trace->startsolid checks are 'ignored'
pm_player_trace_hook.create(0x2D14C0_b, &pm_player_trace_stub);
// If g_enableElevators is 1 the 'ducked' flag will always be removed from the player state
utils::hook::jump(0x2C9F90_b, utils::hook::assemble(pm_trace_stub), true);
dvars::g_enableElevators = dvars::register_bool("g_enableElevators", false, game::DvarFlags::DVAR_FLAG_NONE, "Enables Elevators");
dvars::g_enableElevators = dvars::register_bool("g_enableElevators", false, game::DvarFlags::DVAR_FLAG_NONE, "Enables Elevators");*/
auto* timescale = dvars::register_float("timescale", 1.0f, 0.1f, 50.0f, game::DVAR_FLAG_REPLICATED, "Changes Timescale of the game");
utils::hook::inject(0x15B204_b, &timescale->current.value); // Com_GetTimeScale
utils::hook::inject(0x17D241_b, &timescale->current.value); // Com_Restart
utils::hook::inject(0x17D243_b, &timescale->current.value); // Com_Restart
utils::hook::inject(0x17E609_b, &timescale->current.value); // Com_SetSlowMotion
utils::hook::inject(0x17E626_b, &timescale->current.value); // Com_SetSlowMotion
utils::hook::inject(0x17E69C_b, &timescale->current.value); // Com_SetSlowMotion
// utils::hook::inject(0x1400DB9CC, &timescale->current.value); // Com_ErrorCleanup_Shutdown (Inlined)
utils::hook::inject(0x17EAD0_b, &timescale->current.value); // Com_TimeScaleMsec (Crash)
utils::hook::inject(0x17E69C_b, &timescale->current.value);// Com_SetSlowMotion
//utils::hook::inject(0x17EAAB_b, &timescale->current.value); // Com_ErrorCleanup_Shutdown
utils::hook::inject(0x17EAD0_b, &timescale->current.value); // Com_TimeScaleMsec
utils::hook::inject(0x17EFE2_b, &timescale->current.value); // Com_UpdateSlowMotion
utils::hook::inject(0x17F00C_b, &timescale->current.value); // Com_UpdateSlowMotion
*/
utils::hook::inject(0x17F00C_b, &timescale->current.value); //Com_UpdateSlowMotion
jump_apply_slowdown_hook.create(0x2BD0B0_b, jump_apply_slowdown_stub);
jump_slowDownEnable = dvars::register_bool("jump_slowDownEnable", true, game::DVAR_FLAG_REPLICATED, "Slow player movement after jumping");