]> git.mxchange.org Git - flightgear.git/commitdiff
David Luff:
authorcurt <curt>
Tue, 2 Sep 2003 19:12:11 +0000 (19:12 +0000)
committercurt <curt>
Tue, 2 Sep 2003 19:12:11 +0000 (19:12 +0000)
Firstly, the search of a given runway number was coming out wrong if the
reverse of the one actually in the database was given, resulting in the AI
plane going to the wrong runway.  This was caused by the fact that if the
reverse runway number to the one wanted was matched then revrwyno was
assigned to rwy.rwy_no, whereas actually it was the original runwayno that
should have been assigned.

Secondly, whilst instrumenting the search with couts to see what was going
wrong, I noticed that one runway would come up loads of times.  It turns
out that this is because taxiways and the next airport line were loaded in
as the last runway, with only the type changed, in the constructor.  Thus
the total number of runway entries for all except the last airport equalled
(no-of-runways + no-of-taxiways +  1).  I've changed a couple of lines to
fix this.

[Curt: this was partially fixed last week, but now it should be completely
fixed.  Thanks Dave!]

src/Airports/runways.cxx

index 6450bcd78019642b1611be6ca360e169b87a2291..856c3e5dc0ba82f6dc0e55cc06657bc7d2972456 100644 (file)
@@ -82,7 +82,9 @@ FGRunwayList::FGRunwayList( const string& file ) {
     FGRunway rwy;
     while ( in ) {
         in >> rwy;
-        runways.insert(pair<const string, FGRunway>(rwy.id, rwy));
+        if(rwy.type == "R") {
+            runways.insert(pair<const string, FGRunway>(rwy.id, rwy));
+        }
     }
 }
 
@@ -172,7 +174,9 @@ bool FGRunwayList::search( const string& aptid, const string& rwyno,
             // results if this one matches
             current = pos;
             *r = pos->second;
-           r->rwy_no = revrwyno;
+            // NOTE - matching revrwyno implies that runwayno was
+            // actually correct.
+            r->rwy_no = runwayno;
             r->heading += 180.0;
             string tmp = r->end1_flags;
             r->end1_flags = r->end2_flags;