Make Nasal Flightplan.indexOfWP work on Legs
This commit is contained in:
parent
2acf2aa5ba
commit
b0de9d5a11
1 changed files with 9 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue