Mercurial > hg > openttd
changeset 4792:5a0e1c701644 draft
(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
author | bjarni <bjarni@openttd.org> |
---|---|
date | Tue, 10 Oct 2006 08:14:30 +0000 |
parents | 12222b805092 |
children | 8b7dff194e0f |
files | aircraft_gui.c engine.c rail_cmd.c train_gui.c |
diffstat | 4 files changed, 4 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -548,6 +548,7 @@ case WE_INVALIDATE_DATA: WP(w,buildvehicle_d).data_invalidated = true; + SetWindowDirty(w); break; case WE_DESTROY:
--- a/engine.c +++ b/engine.c @@ -214,7 +214,6 @@ e->preview_player = 0xFF; if (player == _local_player) { InvalidateWindowClassesData(WC_BUILD_VEHICLE); - InvalidateWindowClasses(WC_BUILD_VEHICLE); InvalidateWindowClasses(WC_REPLACE_VEHICLE); } } @@ -339,7 +338,6 @@ 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
--- a/rail_cmd.c +++ b/rail_cmd.c @@ -888,14 +888,9 @@ 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) {