summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-09-06 09:14:55 +0200
committerGitHub <noreply@github.com>2020-09-06 09:14:55 +0200
commit350b1ec67eb237ba57fc5717966ef27858e0e615 (patch)
treeecebf01aa109bc6ee1e924ddc3795f2a7318c036 /src/control
parentMore stinger fix (diff)
parentcheats, fixes, cosmetic changes (diff)
downloadre3-350b1ec67eb237ba57fc5717966ef27858e0e615.tar
re3-350b1ec67eb237ba57fc5717966ef27858e0e615.tar.gz
re3-350b1ec67eb237ba57fc5717966ef27858e0e615.tar.bz2
re3-350b1ec67eb237ba57fc5717966ef27858e0e615.tar.lz
re3-350b1ec67eb237ba57fc5717966ef27858e0e615.tar.xz
re3-350b1ec67eb237ba57fc5717966ef27858e0e615.tar.zst
re3-350b1ec67eb237ba57fc5717966ef27858e0e615.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/TrafficLights.cpp14
-rw-r--r--src/control/TrafficLights.h2
2 files changed, 16 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)
diff --git a/src/control/TrafficLights.h b/src/control/TrafficLights.h
index f3df6cd5..6cd5e04a 100644
--- a/src/control/TrafficLights.h
+++ b/src/control/TrafficLights.h
@@ -16,6 +16,8 @@ enum {
class CTrafficLights
{
public:
+ static bool bGreenLightsCheat;
+
static void DisplayActualLight(CEntity *ent);
static void ScanForLightsOnMap(void);
static int FindTrafficLightType(CEntity *light);