(svn r4924) - Backport from trunk (r4906): 0.4
authorDarkvater
Sat, 20 May 2006 17:33:36 +0000
branch0.4
changeset 10017 e42ff33e973f
parent 10016 7f1dc0e2e0f5
child 10018 ea16b153cdbb
(svn r4924) - Backport from trunk (r4906):
Refresh build vehicle window (if opened) when converting rail depot
rail_cmd.c
--- a/rail_cmd.c	Sat May 20 17:22:32 2006 +0000
+++ b/rail_cmd.c	Sat May 20 17:33:36 2006 +0000
@@ -10,6 +10,7 @@
 #include "tile.h"
 #include "vehicle.h"
 #include "viewport.h"
+#include "window.h"
 #include "command.h"
 #include "pathfind.h"
 #include "engine.h"
@@ -985,6 +986,15 @@
 	if (exec) {
 		SB(_m[tile].m3, 0, 4, totype);
 		MarkTileDirtyByTile(tile);
+
+		/* Update build vehicle window related to this depot */
+		if (IsTileDepotType(tile, TRANSPORT_RAIL)) {
+			Window *w = FindWindowById(WC_BUILD_VEHICLE, tile);
+			if (w != NULL) {
+				WP(w,buildtrain_d).railtype = totype;
+				SetWindowDirty(w);
+			}
+		}
 	}
 
 	return _price.build_rail / 2;