mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 22:09:19 +02: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 ) {
|
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 ) {
|
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 ) {
|
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 )
|
if( ( Train->mvOccupied->LocalBrake != TLocalBrake::ManualBrake )
|
||||||
// Ra 1014-06: AI potrafi zahamować pomocniczym mimo jego braku - odhamować jakoś trzeba
|
// 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
|
// TODO: sort AI out so it doesn't do things it doesn't have equipment for
|
||||||
|| ( Train->mvOccupied->LocalBrakePosA > 0 ) ) {
|
|| ( 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() ) ) {
|
&& ( true == GfxRenderer.Render() ) ) {
|
||||||
glfwPollEvents();
|
glfwPollEvents();
|
||||||
input::Keyboard.poll();
|
input::Keyboard.poll();
|
||||||
|
simulation::Commands.update();
|
||||||
if (input::motiontelemetry)
|
if (input::motiontelemetry)
|
||||||
input::motiontelemetry->update();
|
input::motiontelemetry->update();
|
||||||
if (screenshot_queued)
|
if (screenshot_queued)
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ commanddescription_sequence Commands_descriptions = {
|
|||||||
{ "secondcontrollerdecreasefast", command_target::vehicle, command_mode::oneoff },
|
{ "secondcontrollerdecreasefast", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "secondcontrollerset", command_target::vehicle, command_mode::oneoff },
|
{ "secondcontrollerset", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "mucurrentindicatorothersourceactivate", 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 },
|
{ "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 },
|
{ "independentbrakedecreasefast", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "independentbrakeset", command_target::vehicle, command_mode::oneoff },
|
{ "independentbrakeset", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "independentbrakebailoff", 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);
|
m_active_continuous.emplace(Command.command);
|
||||||
else if (Command.action == GLFW_RELEASE)
|
else if (Command.action == GLFW_RELEASE)
|
||||||
m_active_continuous.erase(Command.command);
|
m_active_continuous.erase(Command.command);
|
||||||
|
else if (Command.action == GLFW_REPEAT)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lookup = m_commands.emplace( Recipient, commanddata_sequence() );
|
auto lookup = m_commands.emplace( Recipient, commanddata_sequence() );
|
||||||
|
|||||||
Reference in New Issue
Block a user