//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CNPC_VehicleDriver::PrescheduleThink( void ) { if ( !m_hVehicleEntity ) { m_pVehicleInterface = NULL; UTIL_Remove( this ); return; } // Keep up with my vehicle SetAbsOrigin( m_hVehicleEntity->WorldSpaceCenter() ); SetAbsAngles( m_hVehicleEntity->GetAbsAngles() ); BaseClass::PrescheduleThink(); if ( m_NPCState == NPC_STATE_IDLE ) { m_pVehicleInterface->NPC_Brake(); return; } // If we've been picked up by something (dropship probably), abort. if ( m_hVehicleEntity->GetParent() ) { SetState( NPC_STATE_IDLE ); ClearWaypoints(); SetGoalEnt( NULL ); return; } DriveVehicle(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CPropVehicleDriveable::DriveVehicle( CBasePlayer *pPlayer, CUserCmd *ucmd ) { //Lose control when the player dies if ( pPlayer->IsAlive() == false ) return; DriveVehicle( ucmd->frametime, ucmd->buttons, pPlayer->m_afButtonPressed, pPlayer->m_afButtonReleased ); }
void C_ASW_PropJeep_Clientside::DriveVehicle( C_BasePlayer *pPlayer, CUserCmd *ucmd ) { //Lose control when the player dies if ( pPlayer->IsAlive() == false ) return; DriveVehicle( TICK_INTERVAL, ucmd, pPlayer->m_afButtonPressed, pPlayer->m_afButtonReleased ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CPropVehicleDriveable::SetupMove( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move ) { // If the engine's not active, prevent driving if ( !IsEngineOn() ) return; // If the player's entering/exiting the vehicle, prevent movement if ( m_bEnterAnimOn || m_bExitAnimOn ) return; DriveVehicle( player, ucmd ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CPropAirboat::SetupMove( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move ) { DriveVehicle( player, ucmd ); }