diff --git a/Train.cpp b/Train.cpp index af228f59..a0f94962 100644 --- a/Train.cpp +++ b/Train.cpp @@ -886,10 +886,10 @@ void TTrain::OnCommand_secondcontrollerset( TTrain *Train, command_data const &C void TTrain::OnCommand_independentbrakeincrease( TTrain *Train, command_data const &Command ) { - if( Command.action != GLFW_RELEASE ) { + if( Command.action == GLFW_REPEAT ) { if( Train->mvOccupied->LocalBrake != TLocalBrake::ManualBrake ) { - Train->mvOccupied->IncLocalBrakeLevel( 1 ); + Train->mvOccupied->IncLocalBrakeLevel( Global.brake_speed * Command.time_delta * LocalBrakePosNo ); } } } @@ -906,13 +906,13 @@ void TTrain::OnCommand_independentbrakeincreasefast( TTrain *Train, command_data void TTrain::OnCommand_independentbrakedecrease( TTrain *Train, command_data const &Command ) { - if( Command.action != GLFW_RELEASE ) { + if( Command.action == GLFW_REPEAT ) { if( ( Train->mvOccupied->LocalBrake != TLocalBrake::ManualBrake ) // Ra 1014-06: AI potrafi zahamować pomocniczym mimo jego braku - odhamować jakoś trzeba // TODO: sort AI out so it doesn't do things it doesn't have equipment for || ( Train->mvOccupied->LocalBrakePosA > 0 ) ) { - Train->mvOccupied->DecLocalBrakeLevel( 1 ); + Train->mvOccupied->DecLocalBrakeLevel( Global.brake_speed * Command.time_delta * LocalBrakePosNo ); } } } diff --git a/application.cpp b/application.cpp index bdc68b19..bf3402e8 100644 --- a/application.cpp +++ b/application.cpp @@ -250,6 +250,7 @@ eu07_application::run() && ( true == GfxRenderer.Render() ) ) { glfwPollEvents(); input::Keyboard.poll(); + simulation::Commands.update(); if (input::motiontelemetry) input::motiontelemetry->update(); if (screenshot_queued) diff --git a/command.cpp b/command.cpp index 6eef3f36..ebd694ae 100644 --- a/command.cpp +++ b/command.cpp @@ -33,9 +33,9 @@ commanddescription_sequence Commands_descriptions = { { "secondcontrollerdecreasefast", command_target::vehicle, command_mode::oneoff }, { "secondcontrollerset", command_target::vehicle, command_mode::oneoff }, { "mucurrentindicatorothersourceactivate", command_target::vehicle, command_mode::oneoff }, - { "independentbrakeincrease", command_target::vehicle, command_mode::oneoff }, + { "independentbrakeincrease", command_target::vehicle, command_mode::continuous }, { "independentbrakeincreasefast", command_target::vehicle, command_mode::oneoff }, - { "independentbrakedecrease", command_target::vehicle, command_mode::oneoff }, + { "independentbrakedecrease", command_target::vehicle, command_mode::continuous }, { "independentbrakedecreasefast", command_target::vehicle, command_mode::oneoff }, { "independentbrakeset", command_target::vehicle, command_mode::oneoff }, { "independentbrakebailoff", command_target::vehicle, command_mode::oneoff }, @@ -234,6 +234,8 @@ command_queue::push( command_data const &Command, std::size_t const Recipient ) m_active_continuous.emplace(Command.command); else if (Command.action == GLFW_RELEASE) m_active_continuous.erase(Command.command); + else if (Command.action == GLFW_REPEAT) + return; } auto lookup = m_commands.emplace( Recipient, commanddata_sequence() );