summaryrefslogtreecommitdiffstats
path: root/src/control/CarAI.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-08-11 19:11:54 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-08-11 19:11:54 +0200
commit14b945ba08bfa18d8ac61bb7f5c08b299ce8a2b0 (patch)
tree671d1b9f6f0a3b67449f8d41b28724fe890619b4 /src/control/CarAI.cpp
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-14b945ba08bfa18d8ac61bb7f5c08b299ce8a2b0.tar
re3-14b945ba08bfa18d8ac61bb7f5c08b299ce8a2b0.tar.gz
re3-14b945ba08bfa18d8ac61bb7f5c08b299ce8a2b0.tar.bz2
re3-14b945ba08bfa18d8ac61bb7f5c08b299ce8a2b0.tar.lz
re3-14b945ba08bfa18d8ac61bb7f5c08b299ce8a2b0.tar.xz
re3-14b945ba08bfa18d8ac61bb7f5c08b299ce8a2b0.tar.zst
re3-14b945ba08bfa18d8ac61bb7f5c08b299ce8a2b0.zip
Diffstat (limited to '')
-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 5129f112..470c3d24 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -2,8 +2,21 @@
#include "patcher.h"
#include "CarAI.h"
+#include "AutoPilot.h"
+#include "Timer.h"
+#include "Vehicle.h"
+
WRAPPER void CCarAI::UpdateCarAI(CVehicle*) { EAXJMP(0x413E50); }
WRAPPER void CCarAI::MakeWayForCarWithSiren(CVehicle *veh) { EAXJMP(0x416280); }
WRAPPER eCarMission CCarAI::FindPoliceCarMissionForWantedLevel() { EAXJMP(0x415E30); }
WRAPPER int32 CCarAI::FindPoliceCarSpeedForWantedLevel(CVehicle*) { EAXJMP(0x415EB0); }
WRAPPER void CCarAI::AddPoliceOccupants(CVehicle*) { EAXJMP(0x415C60); }
+
+void CCarAI::CarHasReasonToStop(CVehicle* pVehicle)
+{
+ pVehicle->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
+}
+
+STARTPATCHES
+InjectHook(0x415B00, &CCarAI::CarHasReasonToStop, PATCH_JUMP);
+ENDPATCHES \ No newline at end of file