From 2cb19bc34eef84f80639d67c4bf6c0b43d3ef55a Mon Sep 17 00:00:00 2001
From: Ryan Miller <tpbspammail@gmail.com>
Date: Thu, 16 Jun 2011 14:46:29 -0700
Subject: [PATCH] (Animated jetways) Fix nil velocities in AI aircraft crashing
 the whole thing (previous commit fixed MP aircraft, not AI)

---
 Nasal/jetways/jetways.nas | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Nasal/jetways/jetways.nas b/Nasal/jetways/jetways.nas
index 0db3f8e68..7497390fe 100644
--- a/Nasal/jetways/jetways.nas
+++ b/Nasal/jetways/jetways.nas
@@ -838,9 +838,9 @@ var load_jetways = func(loopid)
    {
    if (!aircraft.getNode("valid", 1).getBoolValue()) continue;
    var connected = aircraft.getNode("connected-to-jetways", 1);
-   var velocity = aircraft.getNode("velocities/true-airspeed-kt").getValue();
+   var velocity = aircraft.getNode("velocities/true-airspeed-kt", 1).getValue();
    # TODO: Find a better way to know when the aircraft is "parked"
-   if (velocity > -1 and velocity < 1)
+   if (velocity != nil and velocity > -1 and velocity < 1)
     {
     if (!connected.getBoolValue()) toggle_jetway_from_model(aircraft);
     connected.setBoolValue(1);