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

partial unification of sound definition and handling for different vehicle types

This commit is contained in:
tmj-fstate
2017-12-23 16:58:12 +01:00
parent bc13e5b0b5
commit 61a2511e1f
6 changed files with 462 additions and 420 deletions

View File

@@ -1538,7 +1538,8 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
Train->m_linebreakerstate = 2;
// for diesels, we complete the engine start here
// TODO: consider arranging a better way to start the diesel engines
if( Train->mvControlled->EngineType == DieselEngine ) {
if( ( Train->mvControlled->EngineType == DieselEngine )
|| ( Train->mvControlled->EngineType == DieselElectric ) ) {
if( Train->mvControlled->MainSwitch( true ) ) {
// side-effects
Train->mvControlled->ConverterSwitch( ( Train->ggConverterButton.GetValue() > 0.5 ) || ( Train->mvControlled->ConverterStart == start::automatic ) );
@@ -1619,7 +1620,8 @@ void TTrain::OnCommand_linebreakertoggle( TTrain *Train, command_data const &Com
else {
// ...after closing the circuit
// we don't need to start the diesel twice, but the other types still need to be launched
if( Train->mvControlled->EngineType != DieselEngine ) {
if( ( Train->mvControlled->EngineType != DieselEngine )
&& ( Train->mvControlled->EngineType != DieselElectric ) ) {
if( Train->mvControlled->MainSwitch( true ) ) {
// side-effects
Train->mvControlled->ConverterSwitch( ( Train->ggConverterButton.GetValue() > 0.5 ) || ( Train->mvControlled->ConverterStart == start::automatic ) );