From aa58d5c7614ad3c13d2d438a4e0767df2645e7fe Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 12 Nov 2015 00:10:40 +0000 Subject: [PATCH] Fix for determining towered vs untowered airports. --- src/Airports/airport.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Airports/airport.cxx b/src/Airports/airport.cxx index 4b0270ea9..c20a96d44 100644 --- a/src/Airports/airport.cxx +++ b/src/Airports/airport.cxx @@ -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); -- 2.39.5