summaryrefslogtreecommitdiffstats
path: root/src/vehicles/CarGen.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-06-05 10:22:15 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-06-05 10:22:15 +0200
commitd325a3d2478c6933edf6aa145481e3b8fcbe5853 (patch)
treee354dec17e72b67b3b9e4b8168e9519b9cab50b9 /src/vehicles/CarGen.cpp
parentmore CBike (diff)
downloadre3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.gz
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.bz2
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.lz
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.xz
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.tar.zst
re3-d325a3d2478c6933edf6aa145481e3b8fcbe5853.zip
Diffstat (limited to 'src/vehicles/CarGen.cpp')
-rw-r--r--src/vehicles/CarGen.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp
index a1d58ab2..e6c3bbf3 100644
--- a/src/vehicles/CarGen.cpp
+++ b/src/vehicles/CarGen.cpp
@@ -3,6 +3,7 @@
#include "CarGen.h"
#include "Automobile.h"
+#include "Bike.h"
#include "Boat.h"
#include "Camera.h"
#include "CarCtrl.h"
@@ -88,7 +89,7 @@ void CCarGenerator::DoInternalProcessing()
pBoat->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle));
pBoat->SetStatus(STATUS_ABANDONED);
pBoat->m_nDoorLock = CARLOCK_UNLOCKED;
- }else{ // TODO(MIAMI): bikes
+ }else{
bool groundFound = false;
CVector pos = m_vecPos;
if (pos.z > -100.0f){
@@ -105,16 +106,23 @@ void CCarGenerator::DoInternalProcessing()
debug("CCarGenerator::DoInternalProcessing - can't find ground z for new car x = %f y = %f \n", m_vecPos.x, m_vecPos.y);
return;
}
- CAutomobile* pCar = new CAutomobile(mi, PARKED_VEHICLE);
- pVehicle = pCar;
- pCar->bIsStatic = false;
- pCar->bEngineOn = false;
- pos.z += pCar->GetDistanceFromCentreOfMassToBaseOfModel();
- pCar->SetPosition(pos);
- pCar->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle));
- pCar->SetStatus(STATUS_ABANDONED);
- pCar->bLightsOn = false;
- pCar->m_nDoorLock = CARLOCK_UNLOCKED;
+ if (CModelInfo::IsBikeModel(mi)) {
+ CBike* pBike = new CBike(mi, PARKED_VEHICLE);
+ pBike->bIsStanding = true;
+ pVehicle = pBike;
+ }
+ else {
+ CAutomobile* pCar = new CAutomobile(mi, PARKED_VEHICLE);
+ pVehicle = pCar;
+ }
+ pVehicle->bIsStatic = false;
+ pVehicle->bEngineOn = false;
+ pos.z += pVehicle->GetDistanceFromCentreOfMassToBaseOfModel();
+ pVehicle->SetPosition(pos);
+ pVehicle->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle));
+ pVehicle->SetStatus(STATUS_ABANDONED);
+ pVehicle->bLightsOn = false;
+ pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
}
CWorld::Add(pVehicle);