summaryrefslogtreecommitdiffstats
path: root/src/control/TrafficLights.cpp
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2019-08-15 04:06:52 +0200
committerGitHub <noreply@github.com>2019-08-15 04:06:52 +0200
commit6909fa283a25410a6d5f2fc93259b71770512ca2 (patch)
treecc187ba965eb71352fae028d3eb7f9f8db463153 /src/control/TrafficLights.cpp
parentCParticleObject done, cDMAudio done (diff)
parentMerge pull request #189 from Nick007J/master (diff)
downloadre3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.gz
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.bz2
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.lz
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.xz
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.zst
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.zip
Diffstat (limited to 'src/control/TrafficLights.cpp')
-rw-r--r--src/control/TrafficLights.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/control/TrafficLights.cpp b/src/control/TrafficLights.cpp
index 73ff6118..61c941b8 100644
--- a/src/control/TrafficLights.cpp
+++ b/src/control/TrafficLights.cpp
@@ -1,5 +1,22 @@
#include "common.h"
#include "patcher.h"
#include "TrafficLights.h"
+#include "Timer.h"
+#include "Vehicle.h"
WRAPPER void CTrafficLights::DisplayActualLight(CEntity *ent) { EAXJMP(0x455800); }
+WRAPPER bool CTrafficLights::ShouldCarStopForLight(CVehicle*, bool) { EAXJMP(0x455350); }
+WRAPPER bool CTrafficLights::ShouldCarStopForBridge(CVehicle*) { EAXJMP(0x456460); }
+
+uint8
+CTrafficLights::LightForPeds(void)
+{
+ uint32 period = CTimer::GetTimeInMilliseconds() & 0x3FFF; // Equals to % 16384
+
+ if (period >= 15384)
+ return PED_LIGHTS_WALK_BLINK;
+ else if (period >= 12000)
+ return PED_LIGHTS_WALK;
+ else
+ return PED_LIGHTS_DONT_WALK;
+} \ No newline at end of file