mirror of https://github.com/FWGS/hlsdk-xash3d
HL 25th anniversary update rpg rocket changes.
This commit is contained in:
parent
538e3a84d7
commit
fb1ff42a60
42
dlls/rpg.cpp
42
dlls/rpg.cpp
|
@ -116,6 +116,25 @@ CRpgRocket *CRpgRocket::CreateRpgRocket( Vector vecOrigin, Vector vecAngles, CBa
|
||||||
return pRocket;
|
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 )
|
void CRpgRocket::Spawn( void )
|
||||||
|
@ -150,10 +169,11 @@ void CRpgRocket::Spawn( void )
|
||||||
//=========================================================
|
//=========================================================
|
||||||
void CRpgRocket::RocketTouch( CBaseEntity *pOther )
|
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.
|
// my launcher is still around, tell it I'm dead.
|
||||||
pLauncher->m_cActiveRockets--;
|
pLauncher->m_cActiveRockets--;
|
||||||
|
m_hLauncher = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
STOP_SOUND( edict(), CHAN_VOICE, "weapons/rocket1.wav" );
|
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;
|
pev->velocity = pev->velocity * 0.2f + vecTarget * flSpeed * 0.798f;
|
||||||
if( pev->waterlevel == 0 && pev->velocity.Length() < 1500.0f )
|
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();
|
Detonate();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// ALERT( at_console, "%.0f\n", flSpeed );
|
// 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;
|
pev->nextthink = gpGlobals->time + 0.1f;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
static void UseSatchelCharges( entvars_t *pevOwner, SATCHELCODE code );
|
static void UseSatchelCharges( entvars_t *pevOwner, SATCHELCODE code );
|
||||||
|
|
||||||
void Explode( Vector vecSrc, Vector vecAim );
|
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 Smoke( void );
|
||||||
|
|
||||||
void EXPORT BounceTouch( CBaseEntity *pOther );
|
void EXPORT BounceTouch( CBaseEntity *pOther );
|
||||||
|
@ -723,6 +723,8 @@ public:
|
||||||
void EXPORT IgniteThink( void );
|
void EXPORT IgniteThink( void );
|
||||||
void EXPORT RocketTouch( CBaseEntity *pOther );
|
void EXPORT RocketTouch( CBaseEntity *pOther );
|
||||||
static CRpgRocket *CreateRpgRocket( Vector vecOrigin, Vector vecAngles, CBaseEntity *pOwner, CRpg *pLauncher );
|
static CRpgRocket *CreateRpgRocket( Vector vecOrigin, Vector vecAngles, CBaseEntity *pOwner, CRpg *pLauncher );
|
||||||
|
void Explode( TraceResult *pTrace, int bitsDamageType );
|
||||||
|
inline CRpg *GetLauncher( void );
|
||||||
|
|
||||||
int m_iTrail;
|
int m_iTrail;
|
||||||
float m_flIgniteTime;
|
float m_flIgniteTime;
|
||||||
|
|
Loading…
Reference in New Issue