Browse Source

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

fix-cwd-path
Roman Chistokhodov 2 years ago committed by GitHub
parent
commit
ae4d65439c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      cl_dll/ev_hldm.cpp
  2. 2
      dlls/tripmine.cpp

3
cl_dll/ev_hldm.cpp

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

2
dlls/tripmine.cpp

@ -454,7 +454,7 @@ void CTripmine::PrimaryAttack( void )
#else #else
flags = 0; flags = 0;
#endif #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 ) if( tr.flFraction < 1.0f )
{ {

Loading…
Cancel
Save