]> git.mxchange.org Git - flightgear.git/commitdiff
Frederic Bouvier:
authorehofman <ehofman>
Mon, 23 Feb 2004 09:48:10 +0000 (09:48 +0000)
committerehofman <ehofman>
Mon, 23 Feb 2004 09:48:10 +0000 (09:48 +0000)
The last change from Curt to Airports/simple.[ch]xx made
GUI/AirportList.cxx not compilable because of the loss of
a '*' in getAirport.

Also : fabs is not defined under MSVC unless <math.h> is
included.

src/Airports/simple.cxx
src/Airports/simple.hxx

index 04a528f956cf27454f0b25d3cd8370bf3c01b0b2..e27946169ca0075f6f6e1365d73af11ad70de9c4 100644 (file)
@@ -27,6 +27,8 @@
 #  include <config.h>
 #endif
 
+#include <math.h>
+
 #include <simgear/compiler.h>
 
 #include <simgear/debug/logstream.hxx>
@@ -52,7 +54,10 @@ operator >> ( istream& in, FGAirport& a )
     in.getline( name, 256 );
     a.name = name;
 
-    a.has_metar = true;         // assume true
+    // a.has_metar = true;         // assume true
+    // only airports with four-letter codes can have metar stations
+    a.has_metar = (isalpha(a.id[0]) && isalpha(a.id[1]) && isalpha(a.id[2])
+        && isalpha(a.id[3]) && !a.id[4]);
 
     return in;
 }
@@ -121,9 +126,9 @@ FGAirportList::size () const
     return airports_array.size();
 }
 
-const FGAirport FGAirportList::getAirport( int index ) const
+const FGAirport *FGAirportList::getAirport( int index ) const
 {
-    return *airports_array[index];
+    return airports_array[index];
 }
 
 
index 2d25e16d5d74dfdc1f1186250044936fe855a8fa..7d3372ecbea3bda853f5f3bba14f94a72d411b7f 100644 (file)
@@ -102,7 +102,7 @@ public:
     /**
      * Return a specific airport, by position.
      */
-    const FGAirport getAirport( int index ) const;
+    const FGAirport *getAirport( int index ) const;
 
 
     /**