Bugfix: make it work on FG next
The problem was that `next` changes the way strings are coerced to booleans when calling `getBoolValue()` on properties. On FG 2020.3, the string "0" is first converted to integer, which gives 0, and then to boolean, which keeps it as 0 (false). On FG Next, "0" is interpreted as a non-empty string, and directly converted to boolean as 1 (true).
This commit is contained in:
+2
-1
@@ -100,7 +100,7 @@ var toFlightplan = func (ofp, fp=nil) {
|
||||
var sidID = nil;
|
||||
var starID = nil;
|
||||
foreach (var ofpFix; ofpFixes) {
|
||||
if (ofpFix.getNode('is_sid_star').getBoolValue()) {
|
||||
if (ofpFix.getNode('is_sid_star').getValue() == 1) {
|
||||
if ((ofpFix.getValue('stage') == 'CLB') and
|
||||
(getprop('/sim/simbrief/options/import-departure') or 0) and
|
||||
(sidID == nil)) {
|
||||
@@ -159,6 +159,7 @@ var toFlightplan = func (ofp, fp=nil) {
|
||||
# we have everything we need; it's now safe-ish to overwrite or
|
||||
# create the actual flightplan
|
||||
|
||||
|
||||
if (fp == nil) {
|
||||
fp = createFlightplan();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user