Client: use frametime over clframetime for the bob.

This commit is contained in:
Marco Cawthorne 2023-02-17 12:24:51 -08:00
parent 7d58725d76
commit 2daaf2b1ad
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
2 changed files with 5 additions and 2 deletions

View File

@ -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);

View File

@ -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;