From 67978f92e553953f8b13710d57741602d796e08f Mon Sep 17 00:00:00 2001
From: ThorstenB <brehmt@gmail.com>
Date: Fri, 28 Jan 2011 00:06:23 +0100
Subject: [PATCH] Proposed fix for #251: Waypoint handling Do not consider
 destination/runway waypoints as done, when these are far away - even if the
 course is off by > 90 degrees.

---
 src/Instrumentation/rnav_waypt_controller.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Instrumentation/rnav_waypt_controller.cxx b/src/Instrumentation/rnav_waypt_controller.cxx
index 09ac2b812..278484d0a 100644
--- a/src/Instrumentation/rnav_waypt_controller.cxx
+++ b/src/Instrumentation/rnav_waypt_controller.cxx
@@ -221,7 +221,7 @@ private:
 
 /**
  * Special controller for runways. For runways, we want very narrow deviation
- * contraints, and to understand that any point along the paved area is
+ * constraints, and to understand that any point along the paved area is
  * equivalent to being 'at' the runway.
  */
 class RunwayCtl : public WayptController
@@ -252,7 +252,7 @@ public:
     double _courseDev = brg - _targetTrack;
     SG_NORMALIZE_RANGE(_courseDev, -180.0, 180.0);
     
-    if (fabs(_courseDev) > 90.0) {
+    if ((fabs(_courseDev) > 90.0) && (_distanceM < _rnav->overflightArmDistanceM())) {
       setDone();
     }
   }