16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 12:49:18 +02:00

Fix lightsset logic

This commit is contained in:
2025-10-01 22:58:13 +02:00
parent 9a9431b4d5
commit af4edcc734

View File

@@ -7352,6 +7352,13 @@ void TDynamicObject::SetLights() {
// set lights on given side if there's no coupling with another vehicle, turn them off otherwise // set lights on given side if there's no coupling with another vehicle, turn them off otherwise
auto const *frontvehicle{(isfrontcaboccupied ? vehicle->Prev(coupling::coupler) : vehicle->Next(coupling::coupler))}; auto const *frontvehicle{(isfrontcaboccupied ? vehicle->Prev(coupling::coupler) : vehicle->Next(coupling::coupler))};
auto const *rearvehicle{(isfrontcaboccupied ? vehicle->Next(coupling::coupler) : vehicle->Prev(coupling::coupler))}; auto const *rearvehicle{(isfrontcaboccupied ? vehicle->Next(coupling::coupler) : vehicle->Prev(coupling::coupler))};
if (MoverParameters->LightsPos == 18)
{
frontvehicle = nullptr;
rearvehicle = nullptr;
}
vehicle->RaLightsSet( vehicle->RaLightsSet(
( frontvehicle == nullptr ? frontlights : 0 ), ( frontvehicle == nullptr ? frontlights : 0 ),
( rearvehicle == nullptr ? rearlights : 0 ) ); ( rearvehicle == nullptr ? rearlights : 0 ) );