mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-23 21:24:27 +00:00
Merge 6f020090bd
This commit is contained in:
parent
19bdc1d01b
commit
9ef79aee9e
@ -109,8 +109,8 @@ CRpgRocket *CRpgRocket::CreateRpgRocket( Vector vecOrigin, Vector vecAngles, CBa
|
||||
pRocket->pev->angles = vecAngles;
|
||||
pRocket->Spawn();
|
||||
pRocket->SetTouch( &CRpgRocket::RocketTouch );
|
||||
pRocket->m_pLauncher = pLauncher;// remember what RPG fired me.
|
||||
pRocket->m_pLauncher->m_cActiveRockets++;// register this missile as active for the launcher
|
||||
pRocket->m_hLauncher = pLauncher;// remember what RPG fired me.
|
||||
pLauncher->m_cActiveRockets++;// register this missile as active for the launcher
|
||||
pRocket->pev->owner = pOwner->edict();
|
||||
|
||||
return pRocket;
|
||||
@ -150,10 +150,10 @@ void CRpgRocket::Spawn( void )
|
||||
//=========================================================
|
||||
void CRpgRocket::RocketTouch( CBaseEntity *pOther )
|
||||
{
|
||||
if( m_pLauncher )
|
||||
if( CRpg* pLauncher = (CRpg*)( (CBaseEntity*)( m_hLauncher ) ) )
|
||||
{
|
||||
// my launcher is still around, tell it I'm dead.
|
||||
m_pLauncher->m_cActiveRockets--;
|
||||
pLauncher->m_cActiveRockets--;
|
||||
}
|
||||
|
||||
STOP_SOUND( edict(), CHAN_VOICE, "weapons/rocket1.wav" );
|
||||
|
@ -1518,7 +1518,7 @@ IMPLEMENT_SAVERESTORE( CRpg, CBasePlayerWeapon )
|
||||
TYPEDESCRIPTION CRpgRocket::m_SaveData[] =
|
||||
{
|
||||
DEFINE_FIELD( CRpgRocket, m_flIgniteTime, FIELD_TIME ),
|
||||
DEFINE_FIELD( CRpgRocket, m_pLauncher, FIELD_CLASSPTR ),
|
||||
DEFINE_FIELD( CRpgRocket, m_hLauncher, FIELD_EHANDLE ),
|
||||
};
|
||||
|
||||
IMPLEMENT_SAVERESTORE( CRpgRocket, CGrenade )
|
||||
|
@ -725,7 +725,7 @@ public:
|
||||
|
||||
int m_iTrail;
|
||||
float m_flIgniteTime;
|
||||
CRpg *m_pLauncher;// pointer back to the launcher that fired me.
|
||||
EHANDLE m_hLauncher; // handle back to the launcher that fired me.
|
||||
};
|
||||
|
||||
class CGauss : public CBasePlayerWeapon
|
||||
|
Loading…
x
Reference in New Issue
Block a user