Fix client tripmine body and weapon bodies passed to EV_WeaponAnimation (#298)

This commit is contained in:
Roman Chistokhodov 2022-08-05 16:21:43 +03:00 committed by GitHub
parent 70516c988f
commit abf08e4520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 21 deletions

View File

@ -486,7 +486,7 @@ static void EV_FireGlock_Impl( event_args_t *args )
if( EV_IsLocal( idx ) )
{
EV_MuzzleFlash();
gEngfuncs.pEventAPI->EV_WeaponAnimation( empty ? GLOCK_SHOOT_EMPTY : GLOCK_SHOOT, 2 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( empty ? GLOCK_SHOOT_EMPTY : GLOCK_SHOOT, 0 );
V_PunchAxis( 0, -2.0 );
}
@ -549,7 +549,7 @@ void EV_FireShotGunDouble( event_args_t *args )
{
// Add muzzle flash to current weapon model
EV_MuzzleFlash();
gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE2, 2 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE2, 0 );
V_PunchAxis( 0, -10.0 );
}
@ -603,7 +603,7 @@ void EV_FireShotGunSingle( event_args_t *args )
{
// Add muzzle flash to current weapon model
EV_MuzzleFlash();
gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE, 2 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE, 0 );
V_PunchAxis( 0, -5.0 );
}
@ -660,7 +660,7 @@ void EV_FireMP5( event_args_t *args )
{
// Add muzzle flash to current weapon model
EV_MuzzleFlash();
gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_FIRE1 + gEngfuncs.pfnRandomLong( 0, 2 ), 2 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_FIRE1 + gEngfuncs.pfnRandomLong( 0, 2 ), 0 );
V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -2, 2 ) );
}
@ -697,7 +697,7 @@ void EV_FireMP52( event_args_t *args )
if( EV_IsLocal( idx ) )
{
gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_LAUNCH, 2 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_LAUNCH, 0 );
V_PunchAxis( 0, -10 );
}
@ -862,7 +862,7 @@ void EV_FireGauss( event_args_t *args )
if( EV_IsLocal( idx ) )
{
V_PunchAxis( 0.0f, -2.0f );
gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 2 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 0 );
if( m_fPrimaryFire == false )
g_flApplyVel = flDamage;
@ -1129,13 +1129,13 @@ void EV_Crowbar( event_args_t *args )
switch( (g_iSwing++) % 3 )
{
case 0:
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK1MISS, 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK1MISS, 0 );
break;
case 1:
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK2MISS, 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK2MISS, 0 );
break;
case 2:
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK3MISS, 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK3MISS, 0 );
break;
}
}
@ -1203,9 +1203,9 @@ void EV_FireCrossbow2( event_args_t *args )
if( EV_IsLocal( idx ) )
{
if( args->iparam1 )
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 0 );
else
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 0 );
}
// Store off the old count
@ -1279,9 +1279,9 @@ void EV_FireCrossbow( event_args_t *args )
if( EV_IsLocal( idx ) )
{
if( args->iparam1 )
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 0 );
else
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 0 );
V_PunchAxis( 0.0f, -2.0f );
}
@ -1321,7 +1321,7 @@ void EV_FireRpg( event_args_t *args )
//Only play the weapon anims if I shot it.
if( EV_IsLocal( idx ) )
{
gEngfuncs.pEventAPI->EV_WeaponAnimation( RPG_FIRE2, 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( RPG_FIRE2, 0 );
V_PunchAxis( 0, -5.0 );
}
@ -1422,7 +1422,7 @@ void EV_EgonFire( event_args_t *args )
//Only play the weapon anims if I shot it.
if( EV_IsLocal( idx ) )
gEngfuncs.pEventAPI->EV_WeaponAnimation( g_fireAnims1[gEngfuncs.pfnRandomLong( 0, 3 )], 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( g_fireAnims1[gEngfuncs.pfnRandomLong( 0, 3 )], 0 );
if( iStartup == 1 && EV_IsLocal( idx ) && !( pBeam || pBeam2 || pFlare ) && cl_lw->value ) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction.
{
@ -1564,7 +1564,7 @@ void EV_HornetGunFire( event_args_t *args )
if( EV_IsLocal( idx ) )
{
V_PunchAxis( 0, gEngfuncs.pfnRandomLong( 0, 2 ) );
gEngfuncs.pEventAPI->EV_WeaponAnimation( HGUN_SHOOT, 1 );
gEngfuncs.pEventAPI->EV_WeaponAnimation( HGUN_SHOOT, 0 );
}
switch( gEngfuncs.pfnRandomLong( 0, 2 ) )

View File

@ -907,11 +907,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
// over the wire ( fixes some animation glitches )
if( g_runfuncs && ( HUD_GetWeaponAnim() != to->client.weaponanim ) )
{
int body = 2;
//Pop the model to body 0.
if( pWeapon == &g_Tripmine )
body = 0;
int body = 0;
//Show laser sight/scope combo
if( pWeapon == &g_Python && bIsMultiplayer() )

View File

@ -364,7 +364,12 @@ void CTripmine::Spawn()
m_iId = WEAPON_TRIPMINE;
SET_MODEL( ENT( pev ), "models/v_tripmine.mdl" );
pev->frame = 0;
#ifdef CLIENT_DLL
pev->body = 0;
#else
pev->body = 3;
#endif
pev->sequence = TRIPMINE_GROUND;
// ResetSequenceInfo();
pev->framerate = 0;