From 0b6dbe9ad0892741538eef26d4b5c4c5573ce946 Mon Sep 17 00:00:00 2001
From: James Turner <zakalawe@mac.com>
Date: Sat, 18 Jan 2014 08:45:20 +0000
Subject: [PATCH] Bug-fix: only set AP altitude for 'at' constraint.

---
 Nasal/route_manager.nas | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Nasal/route_manager.nas b/Nasal/route_manager.nas
index 54c091329..c6b59d4b7 100644
--- a/Nasal/route_manager.nas
+++ b/Nasal/route_manager.nas
@@ -132,7 +132,7 @@ var FMSDelegate = {
         var active = me.flightplan.currentWP();
         if (active == nil) return;
         
-        if (active.alt_cstr_type != nil) {
+        if (active.alt_cstr_type == "at") {
             debug.dump('new WP has valid altitude restriction, setting on AP');
             setprop('/autopilot/settings/target-altitude-ft', active.alt_cstr);
         }