getBoolValue() on an undefined node shall return "false", not "true".
This isn't only more logical, it's also how SGPropertyNode::getBoolValue() acts. The fix has potential to break code, but so far I haven't seen any problems. I added a debug message to my copy and will for a while check all cases that I run into. To check yourself, just add one line: getBoolValue : func { val = me.getValue(); + if(val == nil) { debug.dump(me) } if(me.getType() == "STRING" and val == "false") { 0 } else { val != nil and val != 0 } } This will output a debug message to the terminal for each case where formerly "true" was returned, and now "false" is.
This commit is contained in:
parent
3a3ee3a5d0
commit
0f07c14bd3
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ Node = {
|
|||
getBoolValue : func {
|
||||
val = me.getValue();
|
||||
if(me.getType() == "STRING" and val == "false") { 0 }
|
||||
else { val != 0 }
|
||||
else { val != nil and val != 0 }
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue