Ensure that cached decel values of free wagon chain heads are zeroed

This commit is contained in:
Jonathan G Rennison
2021-04-01 01:23:08 +01:00
parent 8fd4f65a85
commit dc8680eec5

View File

@@ -349,6 +349,9 @@ void Train::ConsistChanged(ConsistChangeFlags allowed_changes)
InvalidateWindowData(WC_VEHICLE_REFIT, this->index, VIWD_CONSIST_CHANGED); InvalidateWindowData(WC_VEHICLE_REFIT, this->index, VIWD_CONSIST_CHANGED);
InvalidateWindowData(WC_VEHICLE_ORDERS, this->index, VIWD_CONSIST_CHANGED); InvalidateWindowData(WC_VEHICLE_ORDERS, this->index, VIWD_CONSIST_CHANGED);
InvalidateNewGRFInspectWindow(GSF_TRAINS, this->index); InvalidateNewGRFInspectWindow(GSF_TRAINS, this->index);
} else {
this->tcache.cached_deceleration = 0;
this->tcache.cached_uncapped_decel = 0;
} }
if (allowed_changes & CCF_LENGTH) { if (allowed_changes & CCF_LENGTH) {
for (Train *u = this->Next(); u != nullptr; u = u->Next()) { for (Train *u = this->Next(); u != nullptr; u = u->Next()) {