summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-13 16:50:20 +0000
committerdarkvater <darkvater@openttd.org>2005-01-13 16:50:20 +0000
commit16b8912f06795a6e9990a5ac6e16973a39013fb8 (patch)
tree75199ad8fbca21b3b52f2f5e212fe0ee70d9aa0e /main_gui.c
parent84adfdf8c865e33e18f9e79328c37eaa6bfbcb88 (diff)
downloadopenttd-16b8912f06795a6e9990a5ac6e16973a39013fb8.tar.xz
(svn r1497) -Fix: [1101179] Crash if generating land while industry window is open. This also happened for towns and the land information window
-Added DeleteWindowByClass() function that deletes all windows of a given class
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/main_gui.c b/main_gui.c
index 63937fe6a..023a645a3 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -1097,10 +1097,13 @@ static void AskResetLandscapeWndProc(Window *w, WindowEvent *e)
break;
case 4:
DeleteWindow(w);
- if(mode) { // reset landscape
+ DeleteWindowByClass(WC_INDUSTRY_VIEW);
+ DeleteWindowByClass(WC_TOWN_VIEW);
+ DeleteWindowByClass(WC_LAND_INFO);
+
+ if (mode) { // reset landscape
ResetLandscape();
- }
- else { // make random landscape
+ } else { // make random landscape
SndPlayFx(SND_15_BEEP);
_switch_mode = SM_GENRANDLAND;
}