summaryrefslogtreecommitdiffstats
path: root/src/control/TrafficLights.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-09-11 15:39:35 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-09-11 15:39:35 +0200
commitf0b15ee053ec0e4a26652f552e59701a778a201a (patch)
treed57abdfde1eb05f5999a9857a0473cde68239dca /src/control/TrafficLights.cpp
parentfixes (diff)
parentMerge pull request #701 from erorcun/miami (diff)
downloadre3-f0b15ee053ec0e4a26652f552e59701a778a201a.tar
re3-f0b15ee053ec0e4a26652f552e59701a778a201a.tar.gz
re3-f0b15ee053ec0e4a26652f552e59701a778a201a.tar.bz2
re3-f0b15ee053ec0e4a26652f552e59701a778a201a.tar.lz
re3-f0b15ee053ec0e4a26652f552e59701a778a201a.tar.xz
re3-f0b15ee053ec0e4a26652f552e59701a778a201a.tar.zst
re3-f0b15ee053ec0e4a26652f552e59701a778a201a.zip
Diffstat (limited to 'src/control/TrafficLights.cpp')
-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 54c97d06..5559b1c4 100644
--- a/src/control/TrafficLights.cpp
+++ b/src/control/TrafficLights.cpp
@@ -18,6 +18,8 @@
// TODO: figure out the meaning of this
enum { SOME_FLAG = 0x80 };
+bool CTrafficLights::bGreenLightsCheat;
+
void
CTrafficLights::DisplayActualLight(CEntity *ent)
{
@@ -310,6 +312,12 @@ CTrafficLights::LightForPeds(void)
uint8
CTrafficLights::LightForCars1(void)
{
+ if (CWeather::Wind > 1.1f)
+ return CAR_LIGHTS_GREEN;
+
+ if (bGreenLightsCheat)
+ return CAR_LIGHTS_GREEN;
+
uint32 period = CTimer::GetTimeInMilliseconds() % 16384;
if(period < 5000)
@@ -323,6 +331,12 @@ CTrafficLights::LightForCars1(void)
uint8
CTrafficLights::LightForCars2(void)
{
+ if (CWeather::Wind > 1.1f)
+ return CAR_LIGHTS_GREEN;
+
+ if (bGreenLightsCheat)
+ return CAR_LIGHTS_GREEN;
+
uint32 period = CTimer::GetTimeInMilliseconds() % 16384;
if(period < 6000)