18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 20:54:59 +01:00

fix: AI wagon inspector sets G/P/R by the instruction Cw-1 (eu07/maszyna#350)

The brake settings the AI chooses for a train (TController::AutoRewident) now
follow Cw-1 (Mw56) §18 and §19:

- freight trains: the 500 m / 1300 t and 300 m / 600 t limits apply to the
  wagons without the locomotives, limits included;
- long locomotive setting: the five wagons on G are counted from the head of
  the train, not again after every locomotive in it;
- a vehicle without the setting the train needs gets the other of G and P;
- passenger trains run on R only with at most three cars on P, fewer than
  those on R; cars with a magnetic rail brake run on R+Mg.

The choice moves to vehicle/brakesetting.{h,cpp} in eu07_core, with unit
tests. The old inspector stays behind the new eu07.ini key
ai.brakesetting.cw1 (default yes; no restores the earlier behaviour).

No game data changes needed.

(eu07/maszyna#350)
This commit is contained in:
jerrrrycho
2026-11-07 21:53:25 +01:00
parent 68fdf1efdf
commit 636d29eb22
7 changed files with 477 additions and 99 deletions

View File

@@ -462,6 +462,7 @@ set(CORE_SOURCES
"utilities/parser.cpp"
"utilities/utilities.cpp"
"scripting/ladderlogic.cpp"
"vehicle/brakesetting.cpp"
"vehicle/handover.cpp"
"vehicle/horn.cpp"
"vehicle/smoke.cpp"