mirror of
https://github.com/FWGS/hlsdk-xash3d
synced 2025-01-18 16:00:35 +01:00
HL 25th anniversary update rpg rocket changes. (#431)
This commit is contained in:
parent
41ee8a8746
commit
938a6e2361
42
dlls/rpg.cpp
42
dlls/rpg.cpp
@ -116,6 +116,25 @@ CRpgRocket *CRpgRocket::CreateRpgRocket( Vector vecOrigin, Vector vecAngles, CBa
|
||||
return pRocket;
|
||||
}
|
||||
|
||||
void CRpgRocket::Explode( TraceResult *pTrace, int bitsDamageType )
|
||||
{
|
||||
if( CRpg *pLauncher = GetLauncher())
|
||||
{
|
||||
// my launcher is still around, tell it I'm dead.
|
||||
pLauncher->m_cActiveRockets--;
|
||||
m_hLauncher = 0;
|
||||
}
|
||||
|
||||
STOP_SOUND( edict(), CHAN_VOICE, "weapons/rocket1.wav" );
|
||||
|
||||
CGrenade::Explode( pTrace, bitsDamageType );
|
||||
}
|
||||
|
||||
CRpg *CRpgRocket::GetLauncher( void )
|
||||
{
|
||||
return (CRpg*)( (CBaseEntity*)m_hLauncher );
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
//=========================================================
|
||||
void CRpgRocket::Spawn( void )
|
||||
@ -150,10 +169,11 @@ void CRpgRocket::Spawn( void )
|
||||
//=========================================================
|
||||
void CRpgRocket::RocketTouch( CBaseEntity *pOther )
|
||||
{
|
||||
if( CRpg* pLauncher = (CRpg*)( (CBaseEntity*)( m_hLauncher ) ) )
|
||||
if( CRpg *pLauncher = GetLauncher())
|
||||
{
|
||||
// my launcher is still around, tell it I'm dead.
|
||||
pLauncher->m_cActiveRockets--;
|
||||
m_hLauncher = 0;
|
||||
}
|
||||
|
||||
STOP_SOUND( edict(), CHAN_VOICE, "weapons/rocket1.wav" );
|
||||
@ -264,17 +284,23 @@ void CRpgRocket::FollowThink( void )
|
||||
}
|
||||
pev->velocity = pev->velocity * 0.2f + vecTarget * flSpeed * 0.798f;
|
||||
if( pev->waterlevel == 0 && pev->velocity.Length() < 1500.0f )
|
||||
{
|
||||
if( CRpg *pLauncher = (CRpg*)( (CBaseEntity*)( m_hLauncher ) ) )
|
||||
{
|
||||
// my launcher is still around, tell it I'm dead.
|
||||
pLauncher->m_cActiveRockets--;
|
||||
}
|
||||
Detonate();
|
||||
}
|
||||
}
|
||||
// ALERT( at_console, "%.0f\n", flSpeed );
|
||||
|
||||
if( CRpg *pLauncher = GetLauncher())
|
||||
{
|
||||
if( ( pev->origin - pLauncher->pev->origin ).Length() > 8192 || gpGlobals->time - m_flIgniteTime > 6.0f )
|
||||
{
|
||||
// my launcher is still around, tell it I'm dead.
|
||||
pLauncher->m_cActiveRockets--;
|
||||
m_hLauncher = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if( UTIL_PointContents( pev->origin ) == CONTENTS_SKY )
|
||||
Detonate();
|
||||
|
||||
pev->nextthink = gpGlobals->time + 0.1f;
|
||||
}
|
||||
#endif
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
static void UseSatchelCharges( entvars_t *pevOwner, SATCHELCODE code );
|
||||
|
||||
void Explode( Vector vecSrc, Vector vecAim );
|
||||
void Explode( TraceResult *pTrace, int bitsDamageType );
|
||||
virtual void Explode( TraceResult *pTrace, int bitsDamageType );
|
||||
void EXPORT Smoke( void );
|
||||
|
||||
void EXPORT BounceTouch( CBaseEntity *pOther );
|
||||
@ -723,6 +723,8 @@ public:
|
||||
void EXPORT IgniteThink( void );
|
||||
void EXPORT RocketTouch( CBaseEntity *pOther );
|
||||
static CRpgRocket *CreateRpgRocket( Vector vecOrigin, Vector vecAngles, CBaseEntity *pOwner, CRpg *pLauncher );
|
||||
void Explode( TraceResult *pTrace, int bitsDamageType );
|
||||
inline CRpg *GetLauncher( void );
|
||||
|
||||
int m_iTrail;
|
||||
float m_flIgniteTime;
|
||||
|
Loading…
x
Reference in New Issue
Block a user