kaosfere / nftools

Tools for NeoFly
MIT License
8 stars 2 forks source link

Airport filters & Rescue orphaned aircraft #3

Open daheise opened 4 years ago

daheise commented 4 years ago

Adds a couple of extra airport filters. nograss is now nodark, and nograss deletes all grass. Airplanes orphaned by airport delete get moved to an airport with similar ident. Move mission cleanup to a function since it is now used several times.

New/changed filters

move_impossible_aircraft()

Owned aircraft may be orphaned when deleting airports. This new function moves orphaned aircraft to a random location with a similar name. 'Similar' is defined as an airport with as many matching leading letters in the ident as possible. If a match isn't found at 3 letters, then back off to 2, then 1, then a random airport anywhere on the planet as a final resort.

This usually results in aircraft being moved fairly close by, but there are edge cases where an aircraft may be teleported hundreds of miles.