mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 13:54:58 +01:00
feat: keep the vehicle odometers between the sessions (#72)
Every vehicle gets an odometer (TMoverParameters::Odometer) counting along with the per-session DistCounter, starting from its state saved in eu07_odometers.txt in the user's settings directory, else from the file a python screen kept it in (kilometry/<name>_przebieg.txt), else from a state made up from the vehicle name. The store is saved every minute of simulation time and on closing. The cab's distcounter: gauge shows the odometer; its .mmd offset seeds a vehicle with no known state. Python screens get it as state["odometer_total"]; state["odometer"] stays the session distance the logbook and mirror scripts count differences of.
This commit is contained in:
@@ -1510,6 +1510,7 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
|
||||
dL)};
|
||||
|
||||
DistCounter += fabs(dL) / 1000.0;
|
||||
Odometer.run(dL);
|
||||
dL = 0;
|
||||
|
||||
// koniec procedury, tu nastepuja dodatkowe procedury pomocnicze
|
||||
@@ -1576,6 +1577,7 @@ double TMoverParameters::FastComputeMovement(double dt, const TTrackShape & /*Sh
|
||||
dL)};
|
||||
|
||||
DistCounter += fabs(dL) / 1000.0;
|
||||
Odometer.run(dL);
|
||||
dL = 0;
|
||||
|
||||
// koniec procedury, tu nastepuja dodatkowe procedury pomocnicze
|
||||
|
||||
Reference in New Issue
Block a user