mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 12:44:59 +01:00
fix: AI wagon inspector cuts out the brake of wagons without G in a train on G (eu07/maszyna#350)
Cw-1 §19.9: in a freight train braked on G, the brake of a vehicle that has
no G setting (e.g. a passenger car with P and R) is cut out. The inspector
put such wagons on P; now it cuts their brake out the way the scenery's '0'
flag does (b_dmg, the distributor's reservoirs emptied), so the brake
releases and stays off.
- The vehicle remembers the inspector cut it out
(TMoverParameters::BrakeCutOutByInspector); the next inspection puts such
a brake back and sets it to what the new train needs. A brake cut out for
any other reason (scenery, player, damage) is never put back; the cab's
cut-out toggle hands an inspector's cut-out over to the player.
- Locomotives and the vehicle the train is driven from keep a working
brake (on P). In the long locomotive setting (§19.3b) the train runs on
P, so a wagon without G stays on P there.
- The braking tables after the settings leave cut-out brakes out.
- §18.3: a car with R whose brake is cut out counts as one on P.
- ai.brakesetting.cw1 no keeps the earlier behaviour: nothing cut out.
The choice and the cutting out stay in vehicle/brakesetting.{h,cpp}, with
unit tests on real wagons.
This commit is contained in:
@@ -2114,6 +2114,8 @@ void TTrain::OnCommand_trainbrakeoperationtoggle(TTrain *Train, command_data con
|
||||
}
|
||||
|
||||
vehicle->MoverParameters->Hamulec->SetBrakeStatus(vehicle->MoverParameters->Hamulec->GetBrakeStatus() ^ b_dmg);
|
||||
// the brake is the player's now, the wagon inspector won't put it back on its own
|
||||
vehicle->MoverParameters->BrakeCutOutByInspector = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user