]> git.mxchange.org Git - flightgear.git/commitdiff
James Turner,
authorehofman <ehofman>
Sun, 14 Sep 2008 14:31:00 +0000 (14:31 +0000)
committerehofman <ehofman>
Sun, 14 Sep 2008 14:31:00 +0000 (14:31 +0000)
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.

src/Airports/simple.cxx

index 8f8c8752974ccea875e5b20d4575a69b6e7da930..354cff448f1f5c6aa530948216ea94eee07bbcaf 100644 (file)
@@ -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;
   }