summaryrefslogtreecommitdiffstats
path: root/src/control/TrafficLights.cpp
diff options
context:
space:
mode:
authormajestic <majesticcoding@gmail.com>2020-08-30 22:47:12 +0200
committermajestic <majesticcoding@gmail.com>2020-09-01 18:42:17 +0200
commit9f43b1988ba44a3704d4e9dbed21d48014694c95 (patch)
treeb558deb3827025a77677144132881dd1f55228d7 /src/control/TrafficLights.cpp
parentMerge pull request #697 from erorcun/miami (diff)
downloadre3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar
re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.gz
re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.bz2
re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.lz
re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.xz
re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.tar.zst
re3-9f43b1988ba44a3704d4e9dbed21d48014694c95.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 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)