mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 16:14:58 +01:00
fix: the odometer store merges the file other simulations saved, keeps a made up state replaceable by the cab's counter
- each process writes its own <file>.<pid>.tmp and renames it in place; before writing it re-reads the file and merges it per vehicle (a known state beats a made up one, else the larger one, never the sum) - a state counted from a made up one is saved as ~<km> and the .mmd counter offset still replaces it later - a vehicle removed from the scenery has its odometer recorded right away
This commit is contained in:
@@ -8890,6 +8890,11 @@ vehicle_table::erase_disabled() {
|
||||
++vehicleiter;
|
||||
}
|
||||
else {
|
||||
// the distance the vehicle ran goes in the odometer store now, it doesn't depend on the vehicle being
|
||||
// kept on the list until the next save (eu07/maszyna#72)
|
||||
if( vehicle->MoverParameters != nullptr ) {
|
||||
odometer::states().record( vehicle->name(), vehicle->MoverParameters->Odometer );
|
||||
}
|
||||
if( vehicle->MyTrack != nullptr
|
||||
&& true == vehicle->MyTrack->RemoveDynamicObject(vehicle) ) {
|
||||
vehicle->MyTrack = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user