]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/markerbeacon.cxx
Prepare and implement reinit methods for instruments
[flightgear.git] / src / Navaids / markerbeacon.cxx
index 3a49e328056fb4f0cedad3b82c10f3ffee051d17..0af44c3a4c812cbb2eb0ba254048ab72597f1682 100644 (file)
@@ -51,6 +51,11 @@ FGMarkerBeaconRecord::create(int aTy, const string& aName, const SGGeod& aPos)
 {
   Type fgpTy = mapType(aTy);
   FGRunway* runway = getRunwayFromName(aName);
+  if (!runway)
+  {
+      SG_LOG(SG_GENERAL, SG_WARN, "Failed to create beacon for unknown runway '" << aName << "'.");
+      return NULL;
+  }
   SGGeod pos(aPos);
   // fudge elevation to the runway elevation if it's not specified
   if (fabs(pos.getElevationFt()) < 0.01) {
@@ -65,4 +70,5 @@ FGMarkerBeaconRecord::FGMarkerBeaconRecord(Type aTy, FGRunway* aRunway, const SG
   FGPositioned(aTy, string(), aPos),
   _runway(aRunway)
 {
+  init(true); // init FGPositioned
 }