Fix props.condition
Previously props.condition threw an error if any of the properties in the condition were not defines. This is contrary to the behaviour of SGCondition, which it seeks to emulate, which considers such undefined properties as having the value 0.0. Now this is the case. This function only appears to be used by tutorials.nas, where this behaviour was seen as discrepancy between the checklist <condition> behaviour and the tutorial <condition> behaviour. See https://sourceforge.net/p/flightgear/codetickets/2394/?page=1
This commit is contained in:
parent
37110ad34a
commit
010bd8c145
1 changed files with 4 additions and 5 deletions
|
@ -452,11 +452,10 @@ var _cond_cmp = func(p, op) {
|
|||
return nil;
|
||||
}
|
||||
}
|
||||
if(left == nil or right == nil) {
|
||||
logprint(LOG_ALERT, "condition: comparing with nil");
|
||||
dump(p);
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (left == nil) left = 0.0;
|
||||
if (right == nil) right = 0.0;
|
||||
|
||||
if(op < 0) return left < right;
|
||||
if(op > 0) return left > right;
|
||||
return left == right;
|
||||
|
|
Loading…
Reference in a new issue