mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
smooth brake fixes
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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() );
|
||||
|
||||
Reference in New Issue
Block a user