From f2e852c9699bd19684065f040568d6d38b50ead1 Mon Sep 17 00:00:00 2001 From: Hirek Date: Tue, 23 Sep 2025 23:21:41 +0200 Subject: [PATCH] Fix rear coupling on python-set light presets --- DynObj.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DynObj.cpp b/DynObj.cpp index 58d76b45..8e7fa06a 100644 --- a/DynObj.cpp +++ b/DynObj.cpp @@ -7334,7 +7334,9 @@ void TDynamicObject::SetLights() { auto const frontlights { automaticmarkers > 0 ? automaticmarkers : MoverParameters->Lights[ front ][ lightpos ] }; auto const rearlights { automaticmarkers > 0 ? automaticmarkers : MoverParameters->Lights[ rear ][ lightpos ] }; auto *vehicle { GetFirstDynamic( MoverParameters->CabOccupied >= 0 ? end::front : end::rear, coupling::control ) }; - while( vehicle != nullptr ) { + while (vehicle != nullptr) + { + if (lightpos == 17) return; // pozycja pythonowa // 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 *rearvehicle { ( isfrontcaboccupied ? vehicle->Next( coupling::coupler ) : vehicle->Prev( coupling::coupler ) ) };