Skip to content

Commit

Permalink
Client: use frametime over clframetime for the bob.
Browse files Browse the repository at this point in the history
  • Loading branch information
eukara committed Feb 17, 2023
1 parent 7d58725 commit 2daaf2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/client/camera.qc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion src/client/viewmodel.qc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2daaf2b

Please sign in to comment.