summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aircraft_gui.c1
-rw-r--r--engine.c2
-rw-r--r--rail_cmd.c7
-rw-r--r--train_gui.c2
4 files changed, 4 insertions, 8 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c
index 6f358e1af..e17387120 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -548,6 +548,7 @@ static void NewAircraftWndProc(Window *w, WindowEvent *e)
case WE_INVALIDATE_DATA:
WP(w,buildvehicle_d).data_invalidated = true;
+ SetWindowDirty(w);
break;
case WE_DESTROY:
diff --git a/engine.c b/engine.c
index 4862bd5fc..049b7295e 100644
--- a/engine.c
+++ b/engine.c
@@ -214,7 +214,6 @@ static void AcceptEnginePreview(Engine *e, PlayerID player)
e->preview_player = 0xFF;
if (player == _local_player) {
InvalidateWindowClassesData(WC_BUILD_VEHICLE);
- InvalidateWindowClasses(WC_BUILD_VEHICLE);
InvalidateWindowClasses(WC_REPLACE_VEHICLE);
}
}
@@ -339,7 +338,6 @@ static void NewVehicleAvailable(Engine *e)
e->flags = (e->flags & ~ENGINE_INTRODUCING) | ENGINE_AVAILABLE;
InvalidateWindowClassesData(WC_BUILD_VEHICLE);
- InvalidateWindowClasses(WC_BUILD_VEHICLE);
InvalidateWindowClasses(WC_REPLACE_VEHICLE);
// Now available for all players
diff --git a/rail_cmd.c b/rail_cmd.c
index 877dec669..ac1c0ec49 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -888,14 +888,9 @@ static int32 DoConvertRail(TileIndex tile, RailType totype, bool exec)
if (IsTileDepotType(tile, TRANSPORT_RAIL)) {
Vehicle *v;
- Window *w;
/* Update build vehicle window related to this depot */
- w = FindWindowById(WC_BUILD_VEHICLE, tile);
- if (w != NULL) {
- WP(w,buildvehicle_d).railtype = totype;
- SetWindowDirty(w);
- }
+ InvalidateWindowData(WC_BUILD_VEHICLE, tile);
/* update power of trains in this depot */
FOR_ALL_VEHICLES(v) {
diff --git a/train_gui.c b/train_gui.c
index 9e948fb9e..cd9eff36f 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -546,7 +546,9 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e)
break;
case WE_INVALIDATE_DATA:
+ if (w->window_number != 0) WP(w,buildvehicle_d).railtype = GetRailType(w->window_number);
WP(w,buildvehicle_d).data_invalidated = true;
+ SetWindowDirty(w);
break;
case WE_DESTROY: