(svn r4906) - Fix: Refresh build vehicle window (if opened) when converting rail depot
authorglx
Thu, 18 May 2006 16:51:42 +0000
changeset 3869 0467c594dfb5
parent 3868 2de0afd113ff
child 3870 d9ebc4ea750a
(svn r4906) - Fix: Refresh build vehicle window (if opened) when converting rail depot
rail_cmd.c
--- a/rail_cmd.c	Thu May 18 15:34:36 2006 +0000
+++ b/rail_cmd.c	Thu May 18 16:51:42 2006 +0000
@@ -861,6 +861,15 @@
 	if (exec) {
 		SetRailType(tile, 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;