diff options
Diffstat (limited to '')
-rw-r--r-- | src/vehicles/Vehicle.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index 4b36b3d3..c90370f6 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -528,9 +528,9 @@ CVehicle::ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelCon if(!bBraking){ if(m_fGasPedal < 0.01f){ if(GetModelIndex() == MI_RCBANDIT) - brake = 0.2f * mod_HandlingManager.field_4 / m_fMass; + brake = 0.2f * mod_HandlingManager.fWheelFriction / m_fMass; else - brake = mod_HandlingManager.field_4 / m_fMass; + brake = mod_HandlingManager.fWheelFriction / m_fMass; #ifdef FIX_BUGS brake *= CTimer::GetTimeStepFix(); #endif @@ -1378,3 +1378,18 @@ CVehicle::GetVehicleAppearance(void) return VEHICLE_APPEARANCE_HELI; return VEHICLE_APPEARANCE_NONE; } + +bool +IsVehiclePointerValid(CVehicle* pVehicle) +{ + if (!pVehicle) + return false; + int index = CPools::GetVehiclePool()->GetJustIndex(pVehicle); +#ifdef FIX_BUGS + if (index < 0 || index >= NUMVEHICLES) +#else + if (index < 0 || index > NUMVEHICLES) +#endif + return false; + return pVehicle->m_vehType == VEHICLE_TYPE_PLANE || pVehicle->m_entryInfoList.first; +} |