From 39854c07409c2212827842124a6d2d33948a5534 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Fri, 11 Nov 2022 14:18:14 -0800 Subject: [PATCH] NSClientPlayer: UpdatePlayerAnimation() is now calling when running player physics, and also run seperately for non predicted player entities during predraw. --- src/shared/NSClientPlayer.h | 2 +- src/shared/NSClientPlayer.qc | 8 +++++--- src/shared/player_pmove.qc | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/shared/NSClientPlayer.h b/src/shared/NSClientPlayer.h index 7626dcb8..ef5b62e7 100644 --- a/src/shared/NSClientPlayer.h +++ b/src/shared/NSClientPlayer.h @@ -91,7 +91,7 @@ NSClientPlayer:NSClientSpectator virtual bool(void) IsPlayer; /** Empty & shared between Client and Server. This is run on every player, every frame, to update their animation cycle. */ - virtual void UpdatePlayerAnimation(void); + virtual void UpdatePlayerAnimation(float); #ifdef CLIENT int sequence; diff --git a/src/shared/NSClientPlayer.qc b/src/shared/NSClientPlayer.qc index 13687619..3d877e6e 100644 --- a/src/shared/NSClientPlayer.qc +++ b/src/shared/NSClientPlayer.qc @@ -141,7 +141,7 @@ NSClientPlayer::ClientInput(void) /* this is where it gets mod specific really fast, as some models may not even support skeletal animation */ void -NSClientPlayer::UpdatePlayerAnimation(void) +NSClientPlayer::UpdatePlayerAnimation(float timelength) { } @@ -180,8 +180,10 @@ NSClientPlayer::predraw(void) /* make sure we're enabling shadow rendering on us! */ effects &= ~EF_NOSHADOW; - /* always advance the player animation in some way */ - UpdatePlayerAnimation(); + /* if this player is not the local player, then physics aren't being run on them + so we need to advance their animation manually */ + if (entnum != player_localentnum) + UpdatePlayerAnimation(clframetime); /* mouth flapping */ UpdatePlayerJaw(getplayerkeyfloat(this.entnum - 1, "voiploudness")); diff --git a/src/shared/player_pmove.qc b/src/shared/player_pmove.qc index 46562372..2966fcd3 100644 --- a/src/shared/player_pmove.qc +++ b/src/shared/player_pmove.qc @@ -363,8 +363,7 @@ NSClientPlayer::Physics_InputPostMove(void) punchangle[2] *= punch; /* player animation code */ - Animation_TimerUpdate((player)this, input_timelength); - Animation_PlayerUpdate((player)this); + UpdatePlayerAnimation(input_timelength); RemoveFlags(FL_FROZEN); ClientInput();