NSClientPlayer: UpdatePlayerAnimation() is now calling when running player physics, and also run seperately for non predicted player entities during predraw.

This commit is contained in:
Marco Cawthorne 2022-11-11 14:18:14 -08:00
parent 298ba7a041
commit 39854c0740
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
3 changed files with 7 additions and 6 deletions

View File

@ -91,7 +91,7 @@ NSClientPlayer:NSClientSpectator
virtual bool(void) IsPlayer; virtual bool(void) IsPlayer;
/** Empty & shared between Client and Server. This is run on every player, every frame, to update their animation cycle. */ /** 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 #ifdef CLIENT
int sequence; int sequence;

View File

@ -141,7 +141,7 @@ NSClientPlayer::ClientInput(void)
/* this is where it gets mod specific really fast, /* this is where it gets mod specific really fast,
as some models may not even support skeletal animation */ as some models may not even support skeletal animation */
void void
NSClientPlayer::UpdatePlayerAnimation(void) NSClientPlayer::UpdatePlayerAnimation(float timelength)
{ {
} }
@ -180,8 +180,10 @@ NSClientPlayer::predraw(void)
/* make sure we're enabling shadow rendering on us! */ /* make sure we're enabling shadow rendering on us! */
effects &= ~EF_NOSHADOW; effects &= ~EF_NOSHADOW;
/* always advance the player animation in some way */ /* if this player is not the local player, then physics aren't being run on them
UpdatePlayerAnimation(); so we need to advance their animation manually */
if (entnum != player_localentnum)
UpdatePlayerAnimation(clframetime);
/* mouth flapping */ /* mouth flapping */
UpdatePlayerJaw(getplayerkeyfloat(this.entnum - 1, "voiploudness")); UpdatePlayerJaw(getplayerkeyfloat(this.entnum - 1, "voiploudness"));

View File

@ -363,8 +363,7 @@ NSClientPlayer::Physics_InputPostMove(void)
punchangle[2] *= punch; punchangle[2] *= punch;
/* player animation code */ /* player animation code */
Animation_TimerUpdate((player)this, input_timelength); UpdatePlayerAnimation(input_timelength);
Animation_PlayerUpdate((player)this);
RemoveFlags(FL_FROZEN); RemoveFlags(FL_FROZEN);
ClientInput(); ClientInput();