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

Fix for switching off batteries with no active cabin and raising pantographs when deactivating cabin

This commit is contained in:
Królik Uszasty
2022-07-24 23:47:46 +02:00
committed by Milek7
parent 7b40fe9a72
commit a6ba375e7a
3 changed files with 47 additions and 15 deletions

View File

@@ -3109,14 +3109,22 @@ bool TMoverParameters::BatterySwitch( bool State, range_t const Notify )
Battery = State;
}
//switching batteries does not require activation
if( Notify != range_t::local ) {
SendCtrlToNext(
"BatterySwitch",
( State ? 1 : 0 ),
CabActive,
1,
( Notify == range_t::unit ?
coupling::control | coupling::permanent :
coupling::control ) );
SendCtrlToNext(
"BatterySwitch",
(State ? 1 : 0),
-1,
(Notify == range_t::unit ?
coupling::control | coupling::permanent :
coupling::control));
}
return ( Battery != initialstate );