re3/src/control/TrafficLights.cpp
Nikolay Korolev 14b945ba08 more CCarCtrl
2019-08-11 20:11:54 +03:00

22 lines
No EOL
638 B
C++

#include "common.h"
#include "patcher.h"
#include "TrafficLights.h"
#include "Timer.h"
#include "Vehicle.h"
WRAPPER void CTrafficLights::DisplayActualLight(CEntity *ent) { EAXJMP(0x455800); }
WRAPPER bool CTrafficLights::ShouldCarStopForLight(CVehicle*, bool) { EAXJMP(0x455350); }
WRAPPER bool CTrafficLights::ShouldCarStopForBridge(CVehicle*) { EAXJMP(0x456460); }
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;
}