]> git.mxchange.org Git - flightgear.git/commitdiff
Fix an edge case in flight-plan inserts.
authorJames Turner <zakalawe@mac.com>
Tue, 26 Jun 2012 14:16:03 +0000 (15:16 +0100)
committerJames Turner <zakalawe@mac.com>
Tue, 26 Jun 2012 14:16:03 +0000 (15:16 +0100)
When inserting with an invalid index, ensure we return the leg based on the fixed-up index, not the original one. Thanks to Matthias Götz for the catch!

src/Navaids/FlightPlan.cxx

index 5f5ba5e713847f5afce27c34be410514df96ae39..b5ff28b455ba7a588e8ad4365ed194c9b72bc805 100644 (file)
@@ -148,7 +148,7 @@ FlightPlan::Leg* FlightPlan::insertWayptAtIndex(Waypt* aWpt, int aIndex)
   }
   
   insertWayptsAtIndex(wps, index);
-  return legAtIndex(aIndex);
+  return legAtIndex(index);
 }
   
 void FlightPlan::insertWayptsAtIndex(const WayptVec& wps, int aIndex)