]> git.mxchange.org Git - flightgear.git/commitdiff
Fix for determining towered vs untowered airports.
authorJames Turner <zakalawe@mac.com>
Thu, 12 Nov 2015 00:10:40 +0000 (00:10 +0000)
committerJames Turner <zakalawe@mac.com>
Mon, 23 Nov 2015 00:47:01 +0000 (00:47 +0000)
src/Airports/airport.cxx

index 4b0270ea9bdda899e90640ad64baabc7391a4557..c20a96d447cad02537f94a5fc1dee85832a9b897 100644 (file)
@@ -684,7 +684,8 @@ void FGAirport::validateTowerData() const
     // offset the tower position away from the runway centerline, if
     // airport has a single runway. Offset by eight times the runway width,
     // an entirely guessed figure.
-    if (numRunways() <= 2) {
+    int runwayCount = numRunways();
+    if ((runwayCount > 0) && (runwayCount <= 2)) {
         FGRunway* runway = getRunwayByIndex(0);
         double hdg = runway->headingDeg() + 90;
         mTowerPosition = SGGeodesy::direct(geod(), hdg, runway->widthM() * 8);