From 2ba54983a2d6df7a644ca79a1441578c245e0cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Thu, 8 Aug 2019 03:21:38 +0300 Subject: Peds --- src/control/TrafficLights.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/control/TrafficLights.cpp') 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 -- cgit v1.2.3