/* <8ee12> ../cstrike/dlls/func_tank.cpp:424 */ void CFuncTank::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { // player controlled turret if (pev->spawnflags & SF_TANK_CANCONTROL) { if (pActivator->Classify() != CLASS_PLAYER) return; if (value == 2 && useType == USE_SET) { ControllerPostFrame(); } else if (!m_pController && useType != USE_OFF) { ((CBasePlayer*)pActivator)->m_pTank = this; StartControl((CBasePlayer*)pActivator); } else { StopControl(); } } else { if (!ShouldToggle(useType, IsActive())) return; if (IsActive()) TankDeactivate(); else TankActivate(); } }
void CFuncTank::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { if ( m_spawnflags & SF_TANK_CANCONTROL ) { // player controlled turret CBasePlayer *pPlayer = ToBasePlayer( pActivator ); if ( !pPlayer ) return; if ( value == 2 && useType == USE_SET ) { ControllerPostFrame(); } else if ( !m_pController && useType != USE_OFF ) { // The player must be within the func_tank controls Assert( m_hControlVolume ); if ( !m_hControlVolume->IsTouching( pPlayer ) ) return; pPlayer->SetUseEntity( this ); StartControl( pPlayer ); } else { StopControl(); } } else { if ( !ShouldToggle( useType, IsActive() ) ) return; if ( IsActive() ) { TankDeactivate(); } else { TankActivate(); } } }
//----------------------------------------------------------------------------- // Purpose: Input handler for deactivating the tank. //----------------------------------------------------------------------------- void CFuncTank::InputDeactivate( inputdata_t &inputdata ) { TankDeactivate(); }