From: James Turner Date: Thu, 12 Nov 2015 00:10:40 +0000 (+0000) Subject: Fix for determining towered vs untowered airports. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aa58d5c7614ad3c13d2d438a4e0767df2645e7fe;p=flightgear.git Fix for determining towered vs untowered airports. --- 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);