1
0
Fork 0

Make Nasal Flightplan.indexOfWP work on Legs

This commit is contained in:
James Turner 2017-09-11 23:30:53 +01:00
parent 2acf2aa5ba
commit b0de9d5a11

View file

@ -2445,6 +2445,15 @@ static naRef f_flightplan_indexOfWp(naContext c, naRef me, int argc, naRef* args
return naNum(fp->findWayptIndex(positioned));
}
FlightPlan::Leg* leg = fpLegGhost(args[0]);
if (leg) {
if (leg->owner() == fp) {
return naNum(leg->index());
}
naRuntimeError(c, "flightplan.indexOfWP called on leg from different flightplan");
}
SGGeod pos;
int argOffset = geodFromArgs(args, 0, argc, pos);
if (argOffset > 0) {