diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-09-30 19:02:47 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-09-30 19:03:01 +0200 |
commit | 595421da3908a2d3e7a1b063605bb3f2a3adb65b (patch) | |
tree | 1fe2f8eb9da450d5f8efdb27f1b9cbd8d541e01c /src/vehicles | |
parent | Fix more (diff) | |
download | re3-595421da3908a2d3e7a1b063605bb3f2a3adb65b.tar re3-595421da3908a2d3e7a1b063605bb3f2a3adb65b.tar.gz re3-595421da3908a2d3e7a1b063605bb3f2a3adb65b.tar.bz2 re3-595421da3908a2d3e7a1b063605bb3f2a3adb65b.tar.lz re3-595421da3908a2d3e7a1b063605bb3f2a3adb65b.tar.xz re3-595421da3908a2d3e7a1b063605bb3f2a3adb65b.tar.zst re3-595421da3908a2d3e7a1b063605bb3f2a3adb65b.zip |
Diffstat (limited to 'src/vehicles')
-rw-r--r-- | src/vehicles/CarGen.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp index 5de478b7..338eaba4 100644 --- a/src/vehicles/CarGen.cpp +++ b/src/vehicles/CarGen.cpp @@ -74,11 +74,12 @@ void CCarGenerator::DoInternalProcessing() } m_nVehicleHandle = CPools::GetVehiclePool()->GetIndex(pBoat); }else{ - bool groundFound = false; + bool groundFound; CVector pos = m_vecPos; if (pos.z > -100.0f){ pos.z = CWorld::FindGroundZFor3DCoord(pos.x, pos.y, pos.z, &groundFound); }else{ + groundFound = false; CColPoint cp; CEntity* pEntity; groundFound = CWorld::ProcessVerticalLine(CVector(pos.x, pos.y, 1000.0f), -1000.0f, @@ -89,7 +90,12 @@ void CCarGenerator::DoInternalProcessing() if (!groundFound) { debug("CCarGenerator::DoInternalProcessing - can't find ground z for new car x = %f y = %f \n", m_vecPos.x, m_vecPos.y); }else{ - CAutomobile* pCar = new CAutomobile(m_nModelIndex, PARKED_VEHICLE); + CAutomobile* pCar; + + // So game crashes if it's bike :D + if (((CVehicleModelInfo*)CModelInfo::GetModelInfo(m_nModelIndex))->m_vehicleType != VEHICLE_TYPE_BIKE) + pCar = new CAutomobile(m_nModelIndex, PARKED_VEHICLE); + pCar->bIsStatic = false; pCar->bEngineOn = false; pos.z += pCar->GetDistanceFromCentreOfMassToBaseOfModel(); |