17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-07 12:13:17 +01:00

Send the reverser position, not the absolute direction, when activating a cab

CabActivisation() passed DirAbsolute (DirActive * CabActive) as the value of the
"Direction" command, which every receiving vehicle stores as its own DirActive.
Every other sender passes DirActive. With the cab at the rear end (CabActive = -1)
the two have opposite signs, so the other units got their reverser flipped
against the controlling one.

It shows whenever a rear cab is activated after the reverser has been set:
- the AI takes over an occupied cab (TakeControl() calls CabActivisation(true)),
  e.g. an EN57 inserted with reardriver and a starting velocity: the motor car
  drives the train backwards;
- a vehicle without automatic cab activation (SA134) driven by the AI from the
  start: the cab is activated by a driver hint after the reverser is set, and
  the two units pull against each other.

Fixes #169.
This commit is contained in:
pwarszawski
2026-09-30 14:51:36 +02:00
parent b67bbb19e6
commit 96be688d13

View File

@@ -2901,7 +2901,7 @@ 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);
SendCtrlToNext("Direction", DirActive, CabActive);
if (InactiveCabFlag & activation::springbrakeoff)
{
SpringBrakeActivate(false);