1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-27 14:14:27 +01:00

Fix #15088: When building a new train, the refit button state may be incorrect. (#15162)

Invalidate vehicle view window when the vehicle chain is changed.

Co-authored-by: Abigail <abigailthomsonhicks@gmail.com>
This commit is contained in:
Peter Nelson
2026-01-24 19:12:22 +00:00
committed by GitHub
parent 6e356eb267
commit 6addf5c704

View File

@@ -244,6 +244,9 @@ void Train::ConsistChanged(ConsistChangeFlags allowed_changes)
InvalidateWindowData(WC_VEHICLE_REFIT, this->index, VIWD_CONSIST_CHANGED);
InvalidateWindowData(WC_VEHICLE_ORDERS, this->index, VIWD_CONSIST_CHANGED);
InvalidateNewGRFInspectWindow(GSF_TRAINS, this->index);
/* If the consist is changed while in a depot, the vehicle view window must be invalidated to update the availability of refitting. */
InvalidateWindowData(WC_VEHICLE_VIEW, this->index, VIWD_CONSIST_CHANGED);
}
}