summaryrefslogtreecommitdiffstats
path: root/src/vehicles
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-10-05 15:10:26 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-10-05 15:10:26 +0200
commit6853be36c8bd293c8ee0b18cd411fc5a3ebe1099 (patch)
tree813ff9d66382eea57625ec5cb2ca1872d12d7113 /src/vehicles
parentfixed darkel/replay (diff)
parentMerge branch 'master' of https://github.com/GTAmodding/re3 into audioFix (diff)
downloadre3-6853be36c8bd293c8ee0b18cd411fc5a3ebe1099.tar
re3-6853be36c8bd293c8ee0b18cd411fc5a3ebe1099.tar.gz
re3-6853be36c8bd293c8ee0b18cd411fc5a3ebe1099.tar.bz2
re3-6853be36c8bd293c8ee0b18cd411fc5a3ebe1099.tar.lz
re3-6853be36c8bd293c8ee0b18cd411fc5a3ebe1099.tar.xz
re3-6853be36c8bd293c8ee0b18cd411fc5a3ebe1099.tar.zst
re3-6853be36c8bd293c8ee0b18cd411fc5a3ebe1099.zip
Diffstat (limited to 'src/vehicles')
-rw-r--r--src/vehicles/CarGen.cpp10
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();