diff options
author | Marius Kintel <marius@kintel.net> | 2013-03-06 04:27:12 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-03-06 04:27:12 (GMT) |
commit | f70578f362c8c2c78036c9de846c20802ac7aa81 (patch) | |
tree | f327de271f14382c0915677a87e53867785551f7 /src/control.cc | |
parent | 32469374cfe2985f936f017a204d4e9d7dcd3e2f (diff) | |
parent | 03be37d16b585e64de87118053206aaae06e7cf8 (diff) |
Merge branch 'master' into epec-kernel
Diffstat (limited to 'src/control.cc')
-rw-r--r-- | src/control.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/control.cc b/src/control.cc index bdd0f40..44847f5 100644 --- a/src/control.cc +++ b/src/control.cc @@ -96,8 +96,10 @@ AbstractNode *ControlModule::evaluate(const Context*, const ModuleInstantiation size_t n = 0; if (inst->argvalues.size() > 0) { double v; - if (inst->argvalues[0].getDouble(v)) - n = v; + if (inst->argvalues[0].getDouble(v)) { + if (v < 0) return NULL; // Disallow negative child indices + n = trunc(v); + } } for (int i = Context::ctx_stack.size()-1; i >= 0; i--) { const Context *c = Context::ctx_stack[i]; |