mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 02:15:00 +01:00
fix(ai): the AI switches the local converter of an interlocked section back on
The player switches the fans of the own ET42 section off (converterlocal_sw) and hands the train to the AI. The AI only works the main converter switch, and takes the converters for running as the other section's is, but with LineContactorsInterlock=Converter the line contactors of the own section stay open and the AI waits at the first controller position forever. - Switching the converters on (the converteron action), the AI also puts the local switch back on in the vehicles under its control whose line contactors wait for their own converter. - With such a switch off the AI doesn't take the engine for ready, so it goes back to preparing it, also when the switch is flipped while it drives. The human driver may still run with a section switched off. - Vehicles without the interlock are left as they were. The lever of the switch in the cab doesn't follow the AI, like the one of the main converter switch; it is set anew when the cab is entered. (eu07/maszyna#460)
This commit is contained in:
@@ -326,6 +326,14 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
|
||||
case driver_hint::converteron: {
|
||||
if( AIControllFlag ) {
|
||||
mvOccupied->ConverterSwitch( true );
|
||||
// the local switch of the converter too, where the line contactors wait for the vehicle's own converter
|
||||
// (LineContactorsInterlock): left off by the human driver, that vehicle would never take power
|
||||
pVehicle->for_each(
|
||||
coupling::control,
|
||||
[]( TDynamicObject * Vehicle ) {
|
||||
auto *vehicle { Vehicle->MoverParameters };
|
||||
if( vehicle->LineContactorsHeldByLocalConverterSwitch() ) {
|
||||
vehicle->ConverterAllowLocal = true; } } );
|
||||
}
|
||||
remove_hint( driver_hint::converteroff );
|
||||
hint(
|
||||
|
||||
Reference in New Issue
Block a user