diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 716768db2d..0cc8628f10 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -630,6 +630,7 @@ public: InvalidateWindowData(WC_REPLACE_VEHICLE, (VehicleType)this->window_number, 0); // Update the autoreplace window InvalidateWindowClassesData(WC_BUILD_VEHICLE); // The build windows needs updating as well + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN); return; } if ((item.flags & EngineDisplayFlags::Shaded) == EngineDisplayFlags::None) e = item.engine_id; diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 66349dca7e..01ec805b6a 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1807,6 +1807,7 @@ struct BuildVehicleWindow : BuildVehicleWindowBase { InvalidateWindowData(WC_REPLACE_VEHICLE, this->vehicle_type, 0); // Update the autoreplace window InvalidateWindowClassesData(WC_BUILD_VEHICLE); // The build windows needs updating as well + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN); return; } if ((item.flags & EngineDisplayFlags::Shaded) == EngineDisplayFlags::None) e = item.engine_id; @@ -1865,6 +1866,7 @@ struct BuildVehicleWindow : BuildVehicleWindowBase { if (refresh) { InvalidateWindowData(WC_REPLACE_VEHICLE, this->vehicle_type, 0); // Update the autoreplace window InvalidateWindowClassesData(WC_BUILD_VEHICLE); // The build windows needs updating as well + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN); return; } } @@ -2563,6 +2565,7 @@ struct BuildVehicleWindowTrainAdvanced final : BuildVehicleWindowBase { if (refresh) { InvalidateWindowData(WC_REPLACE_VEHICLE, this->vehicle_type, 0); // Update the autoreplace window InvalidateWindowClassesData(WC_BUILD_VEHICLE); // The build windows needs updating as well + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN); return; } } @@ -2584,6 +2587,7 @@ struct BuildVehicleWindowTrainAdvanced final : BuildVehicleWindowBase { InvalidateWindowData(WC_REPLACE_VEHICLE, this->vehicle_type, 0); // Update the autoreplace window InvalidateWindowClassesData(WC_BUILD_VEHICLE); // The build windows needs updating as well + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN); return true; } if ((item.flags & EngineDisplayFlags::Shaded) == EngineDisplayFlags::None) e = item.engine_id; diff --git a/src/engine.cpp b/src/engine.cpp index 5ac84021c3..68c0a49a50 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -1202,6 +1202,7 @@ void EnginesMonthlyLoop() if (refresh) { SetWindowClassesDirty(WC_BUILD_VEHICLE); + SetWindowClassesDirty(WC_BUILD_VIRTUAL_TRAIN); SetWindowClassesDirty(WC_REPLACE_VEHICLE); } }