CS Player is now synced with server

There's more TODO:
- Fix sequence transitions (remove animation interpolation or fix lag compensation)
This commit is contained in:
Kamay Xutax 2024-04-03 01:45:56 +02:00
parent 2b45ee9823
commit 070e46c59e
3 changed files with 10 additions and 10 deletions

View file

@ -1713,13 +1713,6 @@ void C_CSPlayer::UpdateClientSideAnimation()
FrameAdvance( 0.0f ); // 0 means to use the time we last advanced instead of a constant FrameAdvance( 0.0f ); // 0 means to use the time we last advanced instead of a constant
} }
// Update the animation data. It does the local check here so this works when using
// a third-person camera (and we don't have valid player angles).
if ( this == C_CSPlayer::GetLocalCSPlayer() )
m_PlayerAnimState->Update( EyeAngles()[YAW], m_angEyeAngles[PITCH] );
else
m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );
if ( GetSequence() != -1 ) if ( GetSequence() != -1 )
{ {
// latch old values // latch old values
@ -2273,7 +2266,14 @@ void C_CSPlayer::Simulate( void )
} }
} }
BaseClass::Simulate(); BaseClass::Simulate();
// Update the animation data. It does the local check here so this works when using
// a third-person camera (and we don't have valid player angles).
if ( this == C_CSPlayer::GetLocalCSPlayer() )
m_PlayerAnimState->Update( EyeAngles()[YAW], m_angEyeAngles[PITCH] );
else
m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );
} }
void C_CSPlayer::ReleaseFlashlight( void ) void C_CSPlayer::ReleaseFlashlight( void )

View file

@ -418,7 +418,7 @@ CCSPlayer::CCSPlayer()
{ {
m_PlayerAnimState = CreatePlayerAnimState( this, this, LEGANIM_9WAY, true ); m_PlayerAnimState = CreatePlayerAnimState( this, this, LEGANIM_9WAY, true );
UseClientSideAnimation(); // UseClientSideAnimation();
m_iLastWeaponFireUsercmd = 0; m_iLastWeaponFireUsercmd = 0;
m_iAddonBits = 0; m_iAddonBits = 0;

View file

@ -103,7 +103,7 @@ CHostage::CHostage()
{ {
g_Hostages.AddToTail( this ); g_Hostages.AddToTail( this );
m_PlayerAnimState = CreateHostageAnimState( this, this, LEGANIM_8WAY, false ); m_PlayerAnimState = CreateHostageAnimState( this, this, LEGANIM_8WAY, false );
UseClientSideAnimation(); // UseClientSideAnimation();
SetBloodColor( BLOOD_COLOR_RED ); SetBloodColor( BLOOD_COLOR_RED );
} }