summaryrefslogtreecommitdiffstats
path: root/src/control/CarAI.cpp
diff options
context:
space:
mode:
authorFire-Head <Fire-Head@users.noreply.github.com>2021-01-12 22:11:15 +0100
committerFire-Head <Fire-Head@users.noreply.github.com>2021-01-12 22:11:15 +0100
commit3e6016dc6ee40372a06b74d24cae2f97428358f2 (patch)
treeff2420d56a8cc4ab1b9c0f43f720e6f6fbb8bc11 /src/control/CarAI.cpp
parentrem gMakeResources (diff)
parentMerge remote-tracking branch 'origin/miami' into lcs (diff)
downloadre3-3e6016dc6ee40372a06b74d24cae2f97428358f2.tar
re3-3e6016dc6ee40372a06b74d24cae2f97428358f2.tar.gz
re3-3e6016dc6ee40372a06b74d24cae2f97428358f2.tar.bz2
re3-3e6016dc6ee40372a06b74d24cae2f97428358f2.tar.lz
re3-3e6016dc6ee40372a06b74d24cae2f97428358f2.tar.xz
re3-3e6016dc6ee40372a06b74d24cae2f97428358f2.tar.zst
re3-3e6016dc6ee40372a06b74d24cae2f97428358f2.zip
Diffstat (limited to 'src/control/CarAI.cpp')
-rw-r--r--src/control/CarAI.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp
index e7f3a546..06438e0a 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -4,6 +4,7 @@
#include "Accident.h"
#include "AutoPilot.h"
+#include "Bridge.h"
#include "CarCtrl.h"
#include "General.h"
#include "HandlingMgr.h"
@@ -74,6 +75,18 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
case STATUS_PLAYER_DISABLED:
break;
case STATUS_SIMPLE:
+ {
+ if (pVehicle->m_pCurGroundEntity && CBridge::ThisIsABridgeObjectMovingUp(pVehicle->m_pCurGroundEntity->GetModelIndex()))
+ pVehicle->SetStatus(STATUS_PHYSICS);
+ CColPoint colPoint;
+ CEntity* pEntity;
+ if ((pVehicle->m_randomSeed & 0x3F) == (CTimer::GetFrameCounter() & 0x3F) &&
+ !CWorld::ProcessVerticalLine(pVehicle->GetPosition(), -2.0f, colPoint, pEntity, true, false, false, false, true, false, nil)) {
+ debug("FLOATING CAR TURNED INTO PHYSICS CAR!\n");
+ pVehicle->SetStatus(STATUS_PHYSICS);
+ }
+ }
+ // fallthough
case STATUS_PHYSICS:
switch (pVehicle->AutoPilot.m_nCarMission) {
case MISSION_RAMPLAYER_FARAWAY: