Fix speed reduction after critical breakdowns.

Previous code set vcache.cached_max_speed directly (and incorrectly),
which did not survive across save/load or network joins.
Instead add a struct Train field to store the number
of critical breakdowns since last service and do the speed reduction
properly in Train::ConsistChanged.
Slightly tweak algorithm for speed reduction.
This commit is contained in:
Jonathan G Rennison
2016-01-18 18:27:51 +00:00
parent b652d1c42a
commit 5e924262f4
5 changed files with 20 additions and 16 deletions

View File

@@ -462,7 +462,7 @@ struct VehicleSettings {
byte extend_vehicle_life; ///< extend vehicle life by this many years
byte road_side; ///< the side of the road vehicles drive on
uint8 plane_crashes; ///< number of plane crashes, 0 = none, 1 = reduced, 2 = normal
bool improved_breakdowns; ///< different types, chances and serverities of breakdowns
bool improved_breakdowns; ///< different types, chances and severities of breakdowns
};
/** Settings related to the economy. */