(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:
12
window.c
12
window.c
@@ -262,6 +262,18 @@ void DeleteWindowById(WindowClass cls, WindowNumber number)
|
||||
DeleteWindow(FindWindowById(cls, number));
|
||||
}
|
||||
|
||||
void DeleteWindowByClass(WindowClass cls)
|
||||
{
|
||||
Window *w;
|
||||
for (w = _windows; w != _last_window;) {
|
||||
if (w->window_class == cls) {
|
||||
DeleteWindow(w);
|
||||
w = _windows;
|
||||
} else
|
||||
w++;
|
||||
}
|
||||
}
|
||||
|
||||
Window *BringWindowToFrontById(WindowClass cls, WindowNumber number)
|
||||
{
|
||||
Window *w = FindWindowById(cls, number);
|
||||
|
||||
Reference in New Issue
Block a user