Andy Ross wrote:

I kinda doubt it.  The bugs that were fixed were about string constant
conversion and not runtime behavior, and were pretty obviously wrong.
It would be pretty pathological to have code that actually depended on
that behavior.

The bug was that string constants (e.g. "1.2") could be folded
together into the same constant when they were numerically equal
(e.g. it comes out as "1.20" at runtime). By definition, this
wouldn't affect anything that used the constants as numbers or
booleans. Melchior discovered the issue when doing string output.



In Nasal is it valid to test for a "false" condition this way:

 auto = props.globals.getNode("/autopilot/locks/speed", 1);
 if ( !auto.getValue() or auto.getValue() == 0 ) {
   # adjust throttle
 } else {
   # adjust target autothrottle speed
 }

It looks like /autopilot/locks/speed is a string field. It appears that "" no longer equals 0. My assumption when I wrote the script (hehe, I think I wrote that script, apologies to whoever if I didn't) was that for the comparison with zero, auto.getValue() would be converted to a compatible type before the comparison. If this isn't the case, then I should probably test if auto.getValue() == "" instead ...

Regards,

Curt.

--
Curtis Olson        http://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:        2f585eeea02e2c79d7b1d8c4963bae2d


_______________________________________________ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to