(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
This commit is contained in:
darkvater
2005-01-13 16:50:20 +00:00
parent 06cc62f40d
commit 61cae70fe5
3 changed files with 19 additions and 3 deletions

View File

@@ -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;
}