2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-22 01:47:45 +01:00

Fix player's death animation in multiplayer.

This commit is contained in:
Andrey Akhmichin 2024-01-27 00:33:17 +05:00
parent deee0dcbfb
commit 325c61f487
2 changed files with 12 additions and 5 deletions

View File

@ -867,7 +867,7 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib )
SetAnimation( PLAYER_DIE );
m_iRespawnFrames = 0;
m_flRespawnTimer = 0;
pev->modelindex = g_ulModelIndexPlayer; // don't use eyes
@ -1270,8 +1270,8 @@ void CBasePlayer::PlayerDeathThink( void )
{
StudioFrameAdvance();
m_iRespawnFrames++; // Note, these aren't necessarily real "frames", so behavior is dependent on # of client movement commands
if( m_iRespawnFrames < 120 ) // Animations should be no longer than this
m_flRespawnTimer = gpGlobals->frametime + m_flRespawnTimer; // Note, these aren't necessarily real "frames", so behavior is dependent on # of client movement commands
if( m_flRespawnTimer < 4.0f ) // Animations should be no longer than this
return;
}
@ -1281,7 +1281,14 @@ void CBasePlayer::PlayerDeathThink( void )
pev->movetype = MOVETYPE_NONE;
if( pev->deadflag == DEAD_DYING )
{
if( g_pGameRules->IsMultiplayer() && pev->movetype == MOVETYPE_NONE )
{
CopyToBodyQue( pev );
pev->modelindex = 0;
}
pev->deadflag = DEAD_DEAD;
}
StopAnimation();
@ -1322,7 +1329,7 @@ void CBasePlayer::PlayerDeathThink( void )
return;
pev->button = 0;
m_iRespawnFrames = 0;
m_flRespawnTimer = 0;
//ALERT( at_console, "Respawn\n" );

View File

@ -188,7 +188,7 @@ public:
Vector m_vecAutoAim;
BOOL m_fOnTarget;
int m_iDeaths;
float m_iRespawnFrames; // used in PlayerDeathThink() to make sure players can always respawn
float m_flRespawnTimer; // used in PlayerDeathThink() to make sure players can always respawn
int m_lastx, m_lasty; // These are the previous update's crosshair angles, DON"T SAVE/RESTORE