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

Fix AI drivers going with dark lights

This commit is contained in:
2025-01-09 15:10:16 +01:00
parent ce57929209
commit 092b0ff168
2 changed files with 40 additions and 33 deletions

View File

@@ -5704,6 +5704,7 @@ void TController::TakeControl( bool const Aidriver, bool const Forcevehiclecheck
{ // teraz AI prowadzi { // teraz AI prowadzi
AIControllFlag = AIdriver; AIControllFlag = AIdriver;
pVehicle->Controller = AIdriver; pVehicle->Controller = AIdriver;
control_lights(); // reinicjalizacja swiatel
mvOccupied->CabActivisation(true); mvOccupied->CabActivisation(true);
iDirection = 0; // kierunek jazdy trzeba dopiero zgadnąć iDirection = 0; // kierunek jazdy trzeba dopiero zgadnąć
TableClear(); // ponowne utworzenie tabelki, bo człowiek mógł pojechać niezgodnie z sygnałami TableClear(); // ponowne utworzenie tabelki, bo człowiek mógł pojechać niezgodnie z sygnałami
@@ -5740,6 +5741,8 @@ void TController::TakeControl( bool const Aidriver, bool const Forcevehiclecheck
} }
else else
{ // a teraz użytkownik { // a teraz użytkownik
if (!is_train() || !is_car()) // gasimy swiatla jesli przejmujemy odstawione
pVehicle->RaLightsSet(0, 0);
AIControllFlag = Humandriver; AIControllFlag = Humandriver;
pVehicle->Controller = Humandriver; pVehicle->Controller = Humandriver;
if( eAction == TAction::actSleep ) { if( eAction == TAction::actSleep ) {

View File

@@ -7095,6 +7095,7 @@ void TDynamicObject::RaLightsSet(int head, int rear)
MoverParameters->iLights[ vehicleend ] = ( head & iInventory[ vehicleend ] ); MoverParameters->iLights[ vehicleend ] = ( head & iInventory[ vehicleend ] );
bool tLeft = MoverParameters->iLights[vehicleend] & (light::auxiliary_left | light::headlight_left); // roboczo czy jakiekolwiek swiatlo z lewej jest zapalone bool tLeft = MoverParameters->iLights[vehicleend] & (light::auxiliary_left | light::headlight_left); // roboczo czy jakiekolwiek swiatlo z lewej jest zapalone
bool tRight = MoverParameters->iLights[vehicleend] & (light::auxiliary_right | light::headlight_right); // a tu z prawej bool tRight = MoverParameters->iLights[vehicleend] & (light::auxiliary_right | light::headlight_right); // a tu z prawej
if (Controller == Humandriver) {
switch (MoverParameters->modernDimmerState) switch (MoverParameters->modernDimmerState)
{ {
case 0: case 0:
@@ -7112,7 +7113,8 @@ void TDynamicObject::RaLightsSet(int head, int rear)
// dlugie przyciemnione // dlugie przyciemnione
DimHeadlights = true; DimHeadlights = true;
HighBeamLights = true; HighBeamLights = true;
MoverParameters->iLights[vehicleend] &= light::headlight_upper | light::rearendsignals | light::redmarker_left | light::redmarker_right | light::rearendsignals; // nie ruszamy gornych i koncowek MoverParameters->iLights[vehicleend] &=
light::headlight_upper | light::rearendsignals | light::redmarker_left | light::redmarker_right | light::rearendsignals; // nie ruszamy gornych i koncowek
MoverParameters->iLights[vehicleend] |= tLeft ? light::highbeamlight_left : 0; // jesli swiatlo z lewej zapalone to odpal dlugie MoverParameters->iLights[vehicleend] |= tLeft ? light::highbeamlight_left : 0; // jesli swiatlo z lewej zapalone to odpal dlugie
MoverParameters->iLights[vehicleend] |= tRight ? light::highbeamlight_right : 0; // a tu z prawej MoverParameters->iLights[vehicleend] |= tRight ? light::highbeamlight_right : 0; // a tu z prawej
break; break;
@@ -7120,7 +7122,8 @@ void TDynamicObject::RaLightsSet(int head, int rear)
// zwykle dlugie // zwykle dlugie
DimHeadlights = false; DimHeadlights = false;
HighBeamLights = true; HighBeamLights = true;
MoverParameters->iLights[vehicleend] &= light::headlight_upper | light::rearendsignals | light::redmarker_left | light::redmarker_right | light::rearendsignals; // nie ruszamy gornych i koncowek MoverParameters->iLights[vehicleend] &=
light::headlight_upper | light::rearendsignals | light::redmarker_left | light::redmarker_right | light::rearendsignals; // nie ruszamy gornych i koncowek
MoverParameters->iLights[vehicleend] |= tLeft ? light::highbeamlight_left : 0; // jesli swiatlo z lewej zapalone to odpal dlugie MoverParameters->iLights[vehicleend] |= tLeft ? light::highbeamlight_left : 0; // jesli swiatlo z lewej zapalone to odpal dlugie
MoverParameters->iLights[vehicleend] |= tRight ? light::highbeamlight_right : 0; // a tu z prawej MoverParameters->iLights[vehicleend] |= tRight ? light::highbeamlight_right : 0; // a tu z prawej
break; break;
@@ -7129,6 +7132,7 @@ void TDynamicObject::RaLightsSet(int head, int rear)
HighBeamLights = false; HighBeamLights = false;
break; break;
} }
}
} }
if( rear >= 0 ) { if( rear >= 0 ) {