diff options
author | bjarni <bjarni@openttd.org> | 2006-10-10 08:14:30 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-10-10 08:14:30 +0000 |
commit | 3dfe48b1892dc160efc1d1d0f6a6efdf732021ea (patch) | |
tree | 64aaeebbbaf19230f218f88798dbb3ec0de726b7 /rail_cmd.c | |
parent | 583fce3fa91d4bdf2a3a943b88d11c667e8c4857 (diff) | |
download | openttd-3dfe48b1892dc160efc1d1d0f6a6efdf732021ea.tar.xz |
(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
Diffstat (limited to 'rail_cmd.c')
-rw-r--r-- | rail_cmd.c | 7 |
1 files changed, 1 insertions, 6 deletions
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) { |