Update Animation_TimerUpdate to conform with upstream Nuclide.

Make player models run timers at the end of every predraw to ensure smooth
animation.
This commit is contained in:
Marco Cawthorne 2021-05-10 12:24:00 +02:00
parent dc378c688b
commit 8878715c85
2 changed files with 6 additions and 5 deletions

View file

@ -184,5 +184,6 @@ Player_PreDraw(base_player pl, int thirdperson)
}
Animation_PlayerUpdate((player)pl);
Animation_TimerUpdate((player)pl, clframetime);
Player_HandleWeaponModel(pl, thirdperson);
}

View file

@ -31,19 +31,19 @@ void Animation_Print(string sWow) {
}
void
Animation_TimerUpdate(player pl)
Animation_TimerUpdate(player pl, float ftime)
{
makevectors([0, pl.angles[1], 0]);
/* top animation is always just being incremented */
pl.anim_top_time += input_timelength;
pl.anim_top_delay -= input_timelength;
pl.anim_top_time += ftime;
pl.anim_top_delay -= ftime;
/* we may be walking backwards, thus decrement bottom */
if (dotproduct(pl.velocity, v_forward) < 0) {
pl.anim_bottom_time -= input_timelength;
pl.anim_bottom_time -= ftime;
} else {
pl.anim_bottom_time += input_timelength;
pl.anim_bottom_time += ftime;
}
}