From 238b34e000b158ee8bf8e1c4dc07b290e937ff72 Mon Sep 17 00:00:00 2001 From: bjarni Date: Tue, 10 Oct 2006 08:14:30 +0000 Subject: (svn r6714) -Codechange: replaced a direct manipulation of windows with InvalidateWindowData() in rail_cmd.c Moved the actual modification of railtype to WE_INVALIDATE_DATA in the train depot handler -Codechange: added SetWindowDirty() to WE_INVALIDATE_DATA as it made no sense to update the list without making the window dirty --- rail_cmd.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'rail_cmd.c') 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) { -- cgit v1.2.3-54-g00ecf