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

build 180531. configurable cooling fans rotation rate, additional reverser position command, minor bug fixes

This commit is contained in:
tmj-fstate
2018-05-31 20:23:15 +02:00
parent 94f923ebb8
commit 1fa2f201f2
13 changed files with 42 additions and 17 deletions

View File

@@ -206,6 +206,7 @@ TTrain::commandhandler_map const TTrain::m_commandhandlers = {
{ user_command::mubrakingindicatortoggle, &TTrain::OnCommand_mubrakingindicatortoggle },
{ user_command::reverserincrease, &TTrain::OnCommand_reverserincrease },
{ user_command::reverserdecrease, &TTrain::OnCommand_reverserdecrease },
{ user_command::reverserforwardhigh, &TTrain::OnCommand_reverserforwardhigh },
{ user_command::reverserforward, &TTrain::OnCommand_reverserforward },
{ user_command::reverserneutral, &TTrain::OnCommand_reverserneutral },
{ user_command::reverserbackward, &TTrain::OnCommand_reverserbackward },
@@ -1464,9 +1465,20 @@ void TTrain::OnCommand_reverserdecrease( TTrain *Train, command_data const &Comm
}
}
void TTrain::OnCommand_reverserforwardhigh( TTrain *Train, command_data const &Command ) {
if( Command.action == GLFW_PRESS ) {
OnCommand_reverserforward( Train, Command );
OnCommand_reverserincrease( Train, Command );
}
}
void TTrain::OnCommand_reverserforward( TTrain *Train, command_data const &Command ) {
if( Command.action == GLFW_PRESS ) {
// HACK: try to move the reverser one position back, in case it's set to "high forward"
OnCommand_reverserdecrease( Train, Command );
if( Train->mvOccupied->ActiveDir < 1 ) {