From: ehofman Date: Sun, 14 Sep 2008 14:31:00 +0000 (+0000) Subject: James Turner, X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=82fcff36da325a0d09f023626a10067ce4f11078;p=flightgear.git James Turner, Regarding the Runway selection bug: The logic here is a bit convoluted, but I also had a dumb bug in normaliseBearing - I was clamping to the wrong range (0..360 instead of -180..180). This caused the scoring code to pick weird runways. I've added some extra cases to my local tests, and here's a fix. --- diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 8f8c87529..354cff448 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -153,11 +153,11 @@ FGAirport::getIteratorForRunwayIdent(const string& aIdent) const static double normaliseBearing(double aBearing) { - while (aBearing < 0.0) { + while (aBearing < -180) { aBearing += 360.0; } - while (aBearing > 360.0) { + while (aBearing > 180.0) { aBearing -= 360.0; }