summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-11-15 13:08:50 +0000
committeralberth <alberth@openttd.org>2009-11-15 13:08:50 +0000
commit8415a2238ff07bc5f0f50a735b8403cffa1d4e10 (patch)
tree855a5d383fc041a5691f57c6edba4fac48ebab65
parentb812a48a8dda9de3a2bd177b6ced4c69995746e5 (diff)
downloadopenttd-8415a2238ff07bc5f0f50a735b8403cffa1d4e10.tar.xz
(svn r18090) -Fix: Only allow raising of WWT_* nested widgets.
-rw-r--r--src/window.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 444e5cca5..034cff2a0 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -250,7 +250,8 @@ void Window::RaiseButtons(bool autoraise)
}
if (this->nested_array != NULL) {
for (uint i = 0; i < this->nested_array_size; i++) {
- if (this->nested_array[i] != NULL && (!autoraise || (this->nested_array[i]->type & WWB_PUSHBUTTON)) && this->IsWidgetLowered(i)) {
+ if (this->nested_array[i] != NULL && (this->nested_array[i]->type & ~WWB_PUSHBUTTON) < WWT_LAST &&
+ (!autoraise || (this->nested_array[i]->type & WWB_PUSHBUTTON)) && this->IsWidgetLowered(i)) {
this->RaiseWidget(i);
this->SetWidgetDirty(i);
}