17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-18 11:29:20 +02:00

Propagate the reverser setting, not its absolute direction.

CabActivisation() sent DirAbsolute under the "Direction" command, while
DirectionForward() and DirectionBackward() send DirActive under the same name.
The receiving end (TMoverParameters::RunInternalCommand) assigns the value
straight to DirActive and derives DirAbsolute from its own CabActive, so the two
senders only agree while CabActive is 1. Activating a rear cab therefore left
every other member of the consist with the reverser set the opposite way.

The symptom was an EMU that stalled and then accelerated backwards after control
changed hands. It was intermittent because the reverser sweep in
sync_consist_reversers() normally repairs the members through the other two call
sites - except on an EZT, where the first DirectionBackward() at DirActive 1 is
consumed by the high-current switch and propagates nothing, leaving the state set
by CabActivisation() in place.

Seen on an EN57 driven from the rear cab: the occupied car held DirActive 1 with
CabActive -1, the motor car and the far cab held DirActive -1 with the same
CabActive, so their DirAbsolute came out inverted.
This commit is contained in:
maj00r
2026-09-06 14:45:12 +02:00
parent e95d4a57bc
commit f4f0b2bb10

View File

@@ -2901,7 +2901,9 @@ bool TMoverParameters::CabActivisation(bool const Enforce)
CabMaster = true;
SecuritySystem.set_enabled(true); // activate the alerter TODO: make it part of control based cab selection
SendCtrlToNext("CabActivisation", 1, CabActive);
SendCtrlToNext("Direction", DirAbsolute, CabActive);
// the handler assigns the value straight to DirActive, so send that and not DirAbsolute -
// the two differ in sign in a rear cab, which left the rest of the consist pulling the other way
SendCtrlToNext("Direction", DirActive, CabActive);
if (InactiveCabFlag & activation::springbrakeoff)
{
SpringBrakeActivate(false);