summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-22 14:40:55 +0000
committerrubidium <rubidium@openttd.org>2009-11-22 14:40:55 +0000
commite7075c7e2b9c73b32bcc07b6eb409db931b1cb7b (patch)
treeb0bd7d5610e3b5a518cc5139897a02d286f923c5
parent5ad4a5e3e2bd5955be21e61a1ae53fa1c363450a (diff)
downloadopenttd-e7075c7e2b9c73b32bcc07b6eb409db931b1cb7b.tar.xz
(svn r18223) -Codechange: remove the requirement of having an index for background widgets
-rw-r--r--src/widget.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index c7372dce0..5ed3e349d 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -1375,9 +1375,8 @@ NWidgetCore *NWidgetSpacer::GetWidgetFromPos(int x, int y)
*/
NWidgetBackground::NWidgetBackground(WidgetType tp, Colours colour, int index, NWidgetPIPContainer *child) : NWidgetCore(tp, colour, true, true, 0x0, STR_NULL)
{
- this->SetIndex(index);
assert(tp == WWT_PANEL || tp == WWT_INSET || tp == WWT_FRAME);
- assert(index >= 0);
+ if (index >= 0) this->SetIndex(index);
this->child = child;
}