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

Don't play tripmine draw animation after placing the last tripmine (#300)

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

View File

@ -1609,6 +1609,7 @@ void EV_TripmineFire( event_args_t *args )
pmtrace_t tr;
idx = args->entindex;
const bool last = args->bparam1 != 0;
VectorCopy( args->origin, vecSrc );
VectorCopy( args->angles, angles );
@ -1631,7 +1632,7 @@ void EV_TripmineFire( event_args_t *args )
gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128.0f, PM_NORMAL, -1, &tr );
//Hit something solid
if( tr.fraction < 1.0f )
if( tr.fraction < 1.0f && !last )
gEngfuncs.pEventAPI->EV_WeaponAnimation ( TRIPMINE_DRAW, 0 );
gEngfuncs.pEventAPI->EV_PopPMStates();

View File

@ -454,7 +454,7 @@ void CTripmine::PrimaryAttack( void )
#else
flags = 0;
#endif
PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, 0, 0 );
PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] == 1, 0 );
if( tr.flFraction < 1.0f )
{