18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 18:47:06 +01:00
Files
maszyna/application
Hirek cf73ee05a6 refactor(ai): the driving flags of the AI are the named fields of DrivingFlags, not bits of iDrivigFlags
TController kept 23 conditions of the movement of the train as the bits of one
int (iDrivigFlags, the TMovementStatus constants), set and tested with masks,
~(a | b), SetFlag(x, -flag) and TestFlag. Each is a condition of its own, set
and cleared on its own, so each is now a bool of its own in DrivingFlags:
stopCloser, stopPoint, active, press, connect, primary, late, stopHere,
startHorn, startHornNow, startHornDone, oerlikons, incSpeed, trackEnd,
switchFound, guardSignal, visibility, doorOpened, pushPull, signalFound,
stopPointFound, guardOpenDoor, departureWarned.

The three horn flags stay three: the code sets them in combinations that
aren't a single state (startHornDone without startHorn, for one).

The debug panel lists the flags set, as before (DrivingFlags::ActiveNames()).

One fix: SetSignal (from the map) put the signal in bit 30 or 31 by its
number, and any other number set the driving flag of that bit (5 made the
driver primary). Only 30 (Pc6) and 31 (A1) mean a signal now, kept in
signalPc6 and signalA1; nothing reads them yet, as before.

No change in behaviour: 1144/1144 tests, golden traces exact against staging
62f7a29b.
2026-11-27 21:01:45 +01:00
..