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:
12
Train.cpp
12
Train.cpp
@@ -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 ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user