mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-20 04:59:11 +00:00
(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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user