From 2daaf2b1addeec33ae212c9d3b74932872dfabf7 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Fri, 17 Feb 2023 12:24:51 -0800 Subject: [PATCH] Client: use frametime over clframetime for the bob. --- src/client/camera.qc | 2 +- src/client/viewmodel.qc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/camera.qc b/src/client/camera.qc index b7fb325..fea2ec7 100644 --- a/src/client/camera.qc +++ b/src/client/camera.qc @@ -45,7 +45,7 @@ Camera_RunBob(__inout vector camera_angle) pCamBob->m_flTime = 0.0f; /* progress has halted, start anew */ return; } else if (pSeat->m_ePlayer.flags & FL_ONGROUND) { - pCamBob->m_flMove = clframetime * (pCamBob->m_flSpeed * 0.01); + pCamBob->m_flMove = frametime * (pCamBob->m_flSpeed * 0.01); } pCamBob->m_flTime = (pCamBob->m_flTime += pCamBob->m_flMove); diff --git a/src/client/viewmodel.qc b/src/client/viewmodel.qc index c771393..459efe1 100644 --- a/src/client/viewmodel.qc +++ b/src/client/viewmodel.qc @@ -56,7 +56,7 @@ Viewmodel_CalcBob(void) iCycle = (pViewBob->m_flBobTime / var_cycle); /* increment the input value for our cycle */ - pViewBob->m_flBobTime += clframetime; + pViewBob->m_flBobTime += frametime; /* calculate the point in the cycle based on the input time */ pViewBob->m_flBobCycle = pViewBob->m_flBobTime - (iCycle * var_cycle); @@ -92,6 +92,9 @@ Viewmodel_GetBob(void) void Viewmodel_ApplyBob(entity gun) { + int s = (float)getproperty(VF_ACTIVESEAT); + pViewBob = &g_viewBobVars[s]; + // Give the gun a tilt effect like in old HL/CS versions if (autocvar(v_bobclassic, 1, "Viewmodel bob classic tilt switch") == 1) { gun.angles[2] = -pViewBob->m_flBob;