mirror of
https://github.com/FWGS/hlsdk-xash3d
synced 2024-11-22 01:47:45 +01:00
Decrement rocket count only if it was successfully created. (#234)
In addition, make smoke effect and swap sides only if rocket was successfully created.
This commit is contained in:
parent
db95d4a1cc
commit
8768594509
@ -757,6 +757,9 @@ void CApache::FireRocket( void )
|
||||
break;
|
||||
}
|
||||
|
||||
CBaseEntity *pRocket = CBaseEntity::Create( "hvr_rocket", vecSrc, pev->angles, edict() );
|
||||
if( pRocket )
|
||||
{
|
||||
MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSrc );
|
||||
WRITE_BYTE( TE_SMOKE );
|
||||
WRITE_COORD( vecSrc.x );
|
||||
@ -767,13 +770,12 @@ void CApache::FireRocket( void )
|
||||
WRITE_BYTE( 12 ); // framerate
|
||||
MESSAGE_END();
|
||||
|
||||
CBaseEntity *pRocket = CBaseEntity::Create( "hvr_rocket", vecSrc, pev->angles, edict() );
|
||||
if( pRocket )
|
||||
pRocket->pev->velocity = pev->velocity + gpGlobals->v_forward * 100.0f;
|
||||
|
||||
m_iRockets--;
|
||||
|
||||
side = - side;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CApache::FireGun()
|
||||
|
Loading…
Reference in New Issue
Block a user