From 715cb531570a06b133f1dd967fff6bf63a258bcb Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 21 Feb 2024 01:17:48 +0100 Subject: [PATCH] Engine: remove deprecated cvar 'cl_move_use_dt' No longer used, the vftable call made when this was false is stubbed and thus will cause movement to bug when unset; removed. --- r5dev/common/global.cpp | 2 - r5dev/common/global.h | 2 - r5dev/engine/client/cl_main.cpp | 65 +++++++++++++++------------------ 3 files changed, 30 insertions(+), 39 deletions(-) diff --git a/r5dev/common/global.cpp b/r5dev/common/global.cpp index a42b4e55..28fcb7bb 100644 --- a/r5dev/common/global.cpp +++ b/r5dev/common/global.cpp @@ -182,7 +182,6 @@ ConVar* bhit_abs_origin = nullptr; ConVar* cl_rcon_inputonly = nullptr; ConVar* cl_quota_stringCmdsPerSecond = nullptr; -ConVar* cl_move_use_dt = nullptr; ConVar* cl_updaterate_mp = nullptr; ConVar* cl_notify_invert_x = nullptr; @@ -562,7 +561,6 @@ void ConVar_InitShipped(void) eula_version = g_pCVar->FindVar("eula_version"); eula_version_accepted = g_pCVar->FindVar("eula_version_accepted"); #ifndef DEDICATED - cl_move_use_dt = g_pCVar->FindVar("cl_move_use_dt"); cl_updaterate_mp = g_pCVar->FindVar("cl_updaterate_mp"); cl_threaded_bone_setup = g_pCVar->FindVar("cl_threaded_bone_setup"); cl_language = g_pCVar->FindVar("cl_language"); diff --git a/r5dev/common/global.h b/r5dev/common/global.h index 971b547f..118e241d 100644 --- a/r5dev/common/global.h +++ b/r5dev/common/global.h @@ -172,8 +172,6 @@ extern ConVar* bhit_abs_origin; extern ConVar* cl_rcon_inputonly; extern ConVar* cl_quota_stringCmdsPerSecond; -extern ConVar* cl_move_use_dt; - extern ConVar* enable_CmdKeyValues; extern ConVar* cl_notify_invert_x; diff --git a/r5dev/engine/client/cl_main.cpp b/r5dev/engine/client/cl_main.cpp index aceb5d30..06a0a4d7 100644 --- a/r5dev/engine/client/cl_main.cpp +++ b/r5dev/engine/client/cl_main.cpp @@ -70,43 +70,38 @@ void CL_MoveEx() float frameTime = 0.0f; - if (cl_move_use_dt->GetBool()) + float timeScale; + float deltaTime; + + if (isPaused) { - float timeScale; - float deltaTime; - - if (isPaused) - { - timeScale = 1.0f; - frameTime = movementCallTime - s_lastMovementCall; - deltaTime = frameTime; - } - else - { - timeScale = hostTimeScale; - frameTime = cl->m_flFrameTime + s_LastFrameTime; - deltaTime = frameTime / timeScale; - } - - // Clamp the frame time to the maximum. - if (deltaTime > maxFrameTime) - frameTime = timeScale * maxFrameTime; - - // Drop this frame if delta time is below the minimum. - const bool dropFrame = (isTimeScaleDefault && deltaTime < minFrameTime); - - // This check originally was 'time < 0.0049999999', but - // that caused problems when the framerate was above 190. - if (dropFrame) - { - s_LastFrameTime = frameTime; - return; - } - - s_LastFrameTime = 0.0; + timeScale = 1.0f; + frameTime = movementCallTime - s_lastMovementCall; + deltaTime = frameTime; } - //else if (isPaused) - // // This hlClient virtual call just returns false. + else + { + timeScale = hostTimeScale; + frameTime = cl->m_flFrameTime + s_LastFrameTime; + deltaTime = frameTime / timeScale; + } + + // Clamp the frame time to the maximum. + if (deltaTime > maxFrameTime) + frameTime = timeScale * maxFrameTime; + + // Drop this frame if delta time is below the minimum. + const bool dropFrame = (isTimeScaleDefault && deltaTime < minFrameTime); + + // This check originally was 'time < 0.0049999999', but + // that caused problems when the framerate was above 190. + if (dropFrame) + { + s_LastFrameTime = frameTime; + return; + } + + s_LastFrameTime = 0.0; // Create and store usercmd structure. g_pHLClient->CreateMove(nextCommandNr, frameTime, !isPaused);