summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2011-02-25 22:04:38 +0000
committeralberth <alberth@openttd.org>2011-02-25 22:04:38 +0000
commit31386c42a7aa51b5b6a7abfc728b9ed4e34df0ea (patch)
tree793449a253b91916b65c373f54b4544a8c6c86b8 /src/widget.cpp
parent1dbc0a20bed5cd85035b4f84a649c4f7386b07ab (diff)
downloadopenttd-31386c42a7aa51b5b6a7abfc728b9ed4e34df0ea.tar.xz
(svn r22145) -Codechange: Do explicit test for non-bool values.
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 364403e30..210ca6c8c 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -2559,9 +2559,9 @@ static int MakeWidgetTree(const NWidgetPart *parts, int count, NWidgetBase **par
}
/* Add sub_widget to parent container if available, otherwise return the widget to the caller. */
- if (nwid_cont) nwid_cont->Add(sub_widget);
- if (nwid_parent) nwid_parent->Add(sub_widget);
- if (!nwid_cont && !nwid_parent) {
+ if (nwid_cont != NULL) nwid_cont->Add(sub_widget);
+ if (nwid_parent != NULL) nwid_parent->Add(sub_widget);
+ if (nwid_cont == NULL && nwid_parent == NULL) {
*parent = sub_widget;
return total_used;
}