mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
vehicle controllers ai logic fixes, minor refactoring
This commit is contained in:
@@ -782,8 +782,8 @@ void TTrain::OnCommand_jointcontrollerset( TTrain *Train, command_data const &Co
|
||||
clamp(
|
||||
1.0 - ( Command.param1 * 2 ),
|
||||
0.0, 1.0 ) );
|
||||
if( Train->mvControlled->MainCtrlPos > 0 ) {
|
||||
Train->set_master_controller( 0 );
|
||||
if( Train->mvControlled->MainCtrlPowerPos() > 0 ) {
|
||||
Train->set_master_controller( Train->mvControlled->MainCtrlZeroPos() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -839,7 +839,7 @@ void TTrain::OnCommand_mastercontrollerdecrease( TTrain *Train, command_data con
|
||||
if( Command.action != GLFW_RELEASE ) {
|
||||
// on press or hold
|
||||
if( ( Train->ggJointCtrl.SubModel != nullptr )
|
||||
&& ( Train->mvControlled->MainCtrlPos == 0 ) ) {
|
||||
&& ( Train->mvControlled->IsMainCtrlZero() ) ) {
|
||||
OnCommand_independentbrakeincrease( Train, Command );
|
||||
}
|
||||
else {
|
||||
@@ -859,7 +859,7 @@ void TTrain::OnCommand_mastercontrollerdecreasefast( TTrain *Train, command_data
|
||||
if( Command.action != GLFW_RELEASE ) {
|
||||
// on press or hold
|
||||
if( ( Train->ggJointCtrl.SubModel != nullptr )
|
||||
&& ( Train->mvControlled->MainCtrlPos == 0 ) ) {
|
||||
&& ( Train->mvControlled->IsMainCtrlZero() ) ) {
|
||||
OnCommand_independentbrakeincreasefast( Train, Command );
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user