FlightGear unterminated index fix

This came up again in FlightGear v2.12.1. The fix is probably very similar in version 2.10.0.3. The error:


Nasal runtime error: unterminated index (looking for ']')
  at C:/Program Files/FlightGear 2.12.1/data/Aircraft/777/Nasal/systems.nas, line 247 [????]
  called from: [...]/data/Aircraft/777/Nasal/systems.nas, line ???
  called from: [...]/data/Nasal/globals.nas, line ???

Option 1 - The Fix, "inline":

As always, the CDATA is only for HTML compliance, not part of the script.




It is very likely that the only necessary line is the "if (index < 0) return;" but I wanted to post this ASAP without going through the variations.

Option 2 - replacement for systems.nas

Discussion

I only see this occasionally, but I saw it immediately when I tested v0.8.0 of my script. I can't conceive of the fix doing unintended harm, but I haven't flown much since I made the change.

Other Bug Fixes

History

Backlink to previous version.

Valid XHTML 1.0 Strict