(svn r14785) -Fix [FS#2132]: vehicle list for station gets closed when station view is closed even when the vehicle list is stickied. Other vehicle lists are not deleted when their 'opening' window gets closed so do the same with the station view.

This commit is contained in:
rubidium
2009-01-02 20:59:04 +00:00
parent 80a35db52c
commit d91baac764
7 changed files with 34 additions and 12 deletions

View File

@@ -492,10 +492,16 @@ Window *FindWindowById(WindowClass cls, WindowNumber number)
* Delete a window by its class and window number (if it is open).
* @param cls Window class
* @param number Number of the window within the window class
* @param force force deletion; if false don't delete when stickied
*/
void DeleteWindowById(WindowClass cls, WindowNumber number)
void DeleteWindowById(WindowClass cls, WindowNumber number, bool force)
{
delete FindWindowById(cls, number);
Window *w = FindWindowById(cls, number);
if (force || w == NULL ||
(w->desc_flags & WDF_STICKY_BUTTON) == 0 ||
(w->flags4 & WF_STICKY) == 0) {
delete w;
}
}
/**