summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-02 20:59:04 +0000
committerrubidium <rubidium@openttd.org>2009-01-02 20:59:04 +0000
commitb3f2f40db7ffe7ff0b89a77d232b32302a38cd8c (patch)
tree12aa6dc7cf0075753009d46f0a0d94eee8def600 /src/window.cpp
parentbde4b6020a001b78052fce910867ce07c8656f76 (diff)
downloadopenttd-b3f2f40db7ffe7ff0b89a77d232b32302a38cd8c.tar.xz
(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.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/window.cpp b/src/window.cpp
index f28d4dbdd..8b4d92ba2 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -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;
+ }
}
/**