mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-11 15:38:12 +00:00
Fix my mistakes. Apply fixes for rpg and tank laser again.
This commit is contained in:
parent
6d2a869ecd
commit
c8ebe744c3
@ -93,6 +93,7 @@ public:
|
||||
BOOL StartControl( CBasePlayer* pController );
|
||||
void StopControl( void );
|
||||
void ControllerPostFrame( void );
|
||||
virtual void StopFire( void ){}
|
||||
|
||||
protected:
|
||||
CBasePlayer* m_pController;
|
||||
@ -369,8 +370,7 @@ BOOL CFuncTank::StartControl( CBasePlayer *pController )
|
||||
|
||||
void CFuncTank::StopControl()
|
||||
{
|
||||
//if( m_pLaser )
|
||||
//m_pLaser->TurnOff();
|
||||
StopFire();
|
||||
|
||||
// TODO: bring back the controllers current weapon
|
||||
if( !m_pController )
|
||||
@ -755,6 +755,7 @@ public:
|
||||
virtual int Save( CSave &save );
|
||||
virtual int Restore( CRestore &restore );
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
virtual void StopFire( void );
|
||||
|
||||
private:
|
||||
CLaser *m_pLaser;
|
||||
@ -859,6 +860,12 @@ void CFuncTankLaser::Fire( const Vector &barrelEnd, const Vector &forward, entva
|
||||
}
|
||||
}
|
||||
|
||||
void CFuncTankLaser::StopFire( void )
|
||||
{
|
||||
if( m_pLaser )
|
||||
m_pLaser->TurnOff();
|
||||
}
|
||||
|
||||
class CFuncTankRocket : public CFuncTank
|
||||
{
|
||||
public:
|
||||
|
@ -4060,52 +4060,6 @@ void CBasePlayer::UpdateClientData( void )
|
||||
m_rgpPlayerItems[i]->UpdateClientData( this );
|
||||
}
|
||||
|
||||
/*if( m_pClientActiveItem != pPlayer->m_pActiveItem )
|
||||
{
|
||||
if( pPlayer->m_pActiveItem == NULL )
|
||||
{
|
||||
// If no weapon, we have to send update here
|
||||
CBasePlayer *plr;
|
||||
for( int i = 1; i <= gpGlobals->maxClients; i++ )
|
||||
{
|
||||
plr = (CBasePlayer *)UTIL_PlayerByIndex( i );
|
||||
if( !plr || !plr->IsObserver() || plr->m_hObserverTarget != pPlayer )
|
||||
continue;
|
||||
|
||||
MESSAGE_BEGIN( MSG_ONE, gmsgCurWeapon, NULL, plr->pev );
|
||||
WRITE_BYTE( 0 );
|
||||
WRITE_BYTE( 0 );
|
||||
WRITE_BYTE( 0 );
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
MESSAGE_BEGIN( MSG_ONE, gmsgCurWeapon, NULL, pPlayer->pev );
|
||||
WRITE_BYTE( 0 );
|
||||
WRITE_BYTE( 0 );
|
||||
WRITE_BYTE( 0 );
|
||||
MESSAGE_END();
|
||||
}
|
||||
else if( this != pPlayer )
|
||||
{
|
||||
// Special case for spectator
|
||||
CBasePlayerWeapon *gun = (CBasePlayerWeapon *)pPlayer->m_pActiveItem->GetWeaponPtr();
|
||||
if( gun )
|
||||
{
|
||||
int state;
|
||||
if( pPlayer->m_fOnTarget )
|
||||
state = WEAPON_IS_ONTARGET;
|
||||
else
|
||||
state = 1;
|
||||
|
||||
MESSAGE_BEGIN( MSG_ONE, gmsgCurWeapon, NULL, pev );
|
||||
WRITE_BYTE( state );
|
||||
WRITE_BYTE( gun->m_iId );
|
||||
WRITE_BYTE( gun->m_iClip );
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Cache and client weapon change
|
||||
m_pClientActiveItem = m_pActiveItem;
|
||||
m_iClientFOV = m_iFOV;
|
||||
|
@ -265,6 +265,11 @@ void CRpgRocket::FollowThink( void )
|
||||
pev->velocity = pev->velocity * 0.2 + vecTarget * flSpeed * 0.798;
|
||||
if( pev->waterlevel == 0 && pev->velocity.Length() < 1500 )
|
||||
{
|
||||
if( CRpg *pLauncher = (CRpg*)( (CBaseEntity*)( m_hLauncher ) ) )
|
||||
{
|
||||
// my launcher is still around, tell it I'm dead.
|
||||
pLauncher->m_cActiveRockets--;
|
||||
}
|
||||
Detonate();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user