aboutsummaryrefslogtreecommitdiff
path: root/gui/newgui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/newgui.cpp')
-rw-r--r--gui/newgui.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index 808dea699d..67cffab6df 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -58,10 +58,13 @@ enum {
// HACK. FIXME. This doesn't belong here. But otherwise it creates compulation problems
GuiObject::GuiObject(Common::String name) : _firstWidget(0) {
- _x = g_gui.evaluator()->getVar(name + ".x");
- _y = g_gui.evaluator()->getVar(name + ".y");
+ if ((_x = g_gui.evaluator()->getVar(name + ".x")) == EVAL_UNDEF_VAR)
+ error("Undefined variable %s.x", name.c_str());
+ if ((_y = g_gui.evaluator()->getVar(name + ".y")) == EVAL_UNDEF_VAR)
+ error("Undefined variable %s.y", name.c_str());
_w = g_gui.evaluator()->getVar(name + ".w");
_h = g_gui.evaluator()->getVar(name + ".h");
+
_name = name;
}