This commit is contained in:
eray orçunus
2019-08-08 03:21:38 +03:00
parent 1fa2fe566c
commit 2ba54983a2
4 changed files with 541 additions and 9 deletions

View File

@ -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;
}

View File

@ -2,8 +2,15 @@
class CEntity;
enum {
PED_LIGHTS_WALK,
PED_LIGHTS_WALK_BLINK,
PED_LIGHTS_DONT_WALK,
};
class CTrafficLights
{
public:
static void DisplayActualLight(CEntity *ent);
static uint8 LightForPeds(void);
};