summaryrefslogtreecommitdiffstats
path: root/src/control/TrafficLights.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-08-10 09:44:39 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-08-10 09:44:39 +0200
commit6a7fdadeaab25e7b17557c30cea4c8be094d9bd9 (patch)
tree76a3086f2819de9248a2a2cabf00f24eeb5e82b0 /src/control/TrafficLights.cpp
parentMore CCarCtrl (diff)
parentfinished CPathFind (diff)
downloadre3-6a7fdadeaab25e7b17557c30cea4c8be094d9bd9.tar
re3-6a7fdadeaab25e7b17557c30cea4c8be094d9bd9.tar.gz
re3-6a7fdadeaab25e7b17557c30cea4c8be094d9bd9.tar.bz2
re3-6a7fdadeaab25e7b17557c30cea4c8be094d9bd9.tar.lz
re3-6a7fdadeaab25e7b17557c30cea4c8be094d9bd9.tar.xz
re3-6a7fdadeaab25e7b17557c30cea4c8be094d9bd9.tar.zst
re3-6a7fdadeaab25e7b17557c30cea4c8be094d9bd9.zip
Diffstat (limited to '')
-rw-r--r--src/control/TrafficLights.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/control/TrafficLights.cpp b/src/control/TrafficLights.cpp
index 73ff6118..f1532ab5 100644
--- a/src/control/TrafficLights.cpp
+++ b/src/control/TrafficLights.cpp
@@ -1,5 +1,19 @@
#include "common.h"
#include "patcher.h"
#include "TrafficLights.h"
+#include "Timer.h"
WRAPPER void CTrafficLights::DisplayActualLight(CEntity *ent) { EAXJMP(0x455800); }
+
+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