mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Improve pantograph selector
- A new parameter has been added to .fiz file format, in the Switches: section: - PantographPresetDefault [0] - The 0-based index of a pantograph preset that should be chosen upon the vehicle creation. 0 by default mimicks the current behavior. - Fixed the selected pantograph configuration not being respected until the configuration has been changed.
This commit is contained in:
@@ -637,6 +637,12 @@ bool TTrain::Init(TDynamicObject *NewDynamicObject, bool e3d)
|
||||
DynamicObject->Mechanik->sync_consist_reversers();
|
||||
}
|
||||
|
||||
// Set the default pantograph preset and update pantographs' valves accordingly.
|
||||
change_pantograph_selection(mvOccupied->PantsPresetDefault);
|
||||
// Avoid double update if the default is other than 0.
|
||||
if (mvOccupied->PantsPresetDefault == 0)
|
||||
update_pantograph_valves();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user