]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/positioned.cxx
Merge branch 'master' into next
[flightgear.git] / src / Navaids / positioned.cxx
index 89660e24c1f06b8e5bb546b02dc899013c36b038..f43e4b82f2eb9ced5192bf31837cbac1a3633f54 100644 (file)
@@ -266,22 +266,22 @@ namedFindClosest(const std::string& aIdent, const SGGeod& aOrigin, FGPositioned:
   SGVec3d cartOrigin(SGVec3d::fromGeod(aOrigin));
   
   for (; it != range.second; ++it) {
-    FGPositioned::Type ty = range.first->second->type();
+    FGPositioned* r = it->second;
     if (aFilter) {
-      if (aFilter->hasTypeRange() && !aFilter->passType(ty)) {
+      if (aFilter->hasTypeRange() && !aFilter->passType(r->type())) {
         continue;
       }
       
-      if (!aFilter->pass(range.first->second)) {
+      if (!aFilter->pass(r)) {
         continue;
       }
     }
     
   // find distance
-    double d2 = distSqr(cartOrigin, it->second->cart());
+    double d2 = distSqr(cartOrigin, r->cart());
     if (d2 < minDist) {
       minDist = d2;
-      result = it->second;
+      result = r;
     }
   }
   
@@ -447,7 +447,7 @@ FGPositioned::FGPositioned(Type ty, const std::string& aIdent, const SGGeod& aPo
   SGReferenced::get(this); // hold an owning ref, for the moment
   
   if (aIndexed) {
-    assert(ty != TAXIWAY);
+    assert(ty != TAXIWAY && ty != PAVEMENT);
     addToIndices(this);
   }
 }
@@ -475,6 +475,7 @@ const char* FGPositioned::nameForType(Type aTy)
  switch (aTy) {
  case RUNWAY: return "runway";
  case TAXIWAY: return "taxiway";
+ case PAVEMENT: return "pavement";
  case PARK_STAND: return "parking stand";
  case FIX: return "fix";
  case VOR: return "VOR";