diff options
author | rubidium <rubidium@openttd.org> | 2008-05-15 14:41:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-15 14:41:56 +0000 |
commit | 5ae795953afac677134e54f91a11436acb3c969d (patch) | |
tree | 43c72cfecc28dfa3d1fafc35fe5d61d59367a67c /src/airport_gui.cpp | |
parent | 8fff6e8638b848b129a3609ef22c0d0b611940e8 (diff) | |
download | openttd-5ae795953afac677134e54f91a11436acb3c969d.tar.xz |
(svn r13104) -Codechange: make ResetObjectToPlace safe to be called recursively via the OnPlaceObjectAbort callback and use this knowledge to simplify closing some windows.
Diffstat (limited to 'src/airport_gui.cpp')
-rw-r--r-- | src/airport_gui.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index b19469ce2..74f5e50d6 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -102,9 +102,7 @@ static void BuildAirToolbWndProc(Window *w, WindowEvent *e) case WE_ABORT_PLACE_OBJ: w->RaiseButtons(); - w = FindWindowById(WC_BUILD_STATION, 0); - if (w != 0) - WP(w, def_d).close = true; + delete FindWindowById(WC_BUILD_STATION, 0); break; case WE_DESTROY: @@ -171,8 +169,6 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e) uint32 avail_airports; const AirportFTAClass *airport; - if (WP(w, def_d).close) return; - avail_airports = GetValidAirports(); w->RaiseWidget(_selected_airport_type + BAW_SMALL_AIRPORT); @@ -230,17 +226,12 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e) } } break; - case WE_TICK: { - if (WP(w, def_d).close) { - delete w; - return; - } - + case WE_TICK: CheckRedrawStationCoverage(w); - } break; + break; case WE_DESTROY: - if (!WP(w, def_d).close) ResetObjectToPlace(); + ResetObjectToPlace(); break; } } |