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:
@@ -726,6 +726,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
|
||||
SLE_CONDNULL(2, 2, 19),
|
||||
SLE_CONDVAR(Train, gv_flags, SLE_UINT16, 139, SL_MAX_VERSION),
|
||||
SLE_CONDNULL(11, 2, 143), // old reserved space
|
||||
SLE_CONDVAR(Train, critical_breakdown_count, SLE_UINT8, SL_IB, SL_MAX_VERSION),
|
||||
|
||||
SLE_END()
|
||||
};
|
||||
|
Reference in New Issue
Block a user