1
0
Fork 0

initNode: make path optional and let it default to "". This is allowed:

props.globals.getNode("sim/foo", 1).initNode();  and equivalent to
    props.globals.getNode("sim").initNode("foo");
This commit is contained in:
mfranz 2008-12-03 20:53:00 +00:00
parent 5c88cdf6f1
commit 8bf823c4fb

View file

@ -129,7 +129,7 @@ Node.getValues = func {
# "DOUBLE" is used for numbers, and STRING for everything else.
# Returns the property as props.Node.
#
Node.initNode = func(path, value = 0, type = nil) {
Node.initNode = func(path = "", value = 0, type = nil) {
var prop = me.getNode(path, 1);
if(prop.getType() != "NONE") value = prop.getValue();
if(type == nil) prop.setValue(value);