summaryrefslogtreecommitdiff
path: root/src/control.cc
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-02-02 19:43:59 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-02-02 19:43:59 (GMT)
commit18e3a7d9ad8e052d626ac250a9c9d5f36f29a54d (patch)
tree565c87e051833daa1c0eed7ffe45533fcf05c2fb /src/control.cc
parent61fffc0e5b92c9bda7e376983fdc90b498eed745 (diff)
parenteb30d42b5dd3ed5bb37336ed46a59eabaca81e06 (diff)
Merge branch 'master' of github.com:openscad/openscad into misc_updates
Conflicts: scripts/uni-build-dependencies.sh
Diffstat (limited to 'src/control.cc')
-rw-r--r--src/control.cc6
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];
contact: Jan Huwald // Impressum