]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATCDCL/tower.cxx
Reset - instruments can be re-inited now (reloads XML files)
[flightgear.git] / src / ATCDCL / tower.cxx
index d1886c3389691a8ca6226f9df68ab6db253d115b..d44e33018b857cad21a50a9060aa18b8d5929b1c 100644 (file)
@@ -55,6 +55,8 @@ using std::cout;
 
 TowerPlaneRec::TowerPlaneRec() :
        planePtr(NULL),
+       eta(0),
+       dist_out(0),
        clearedToLand(false),
        clearedToLineUp(false),
        clearedToTakeOff(false),
@@ -85,6 +87,8 @@ TowerPlaneRec::TowerPlaneRec() :
 
 TowerPlaneRec::TowerPlaneRec(const PlaneRec& p) :
        planePtr(NULL),
+       eta(0),
+       dist_out(0),
        clearedToLand(false),
        clearedToLineUp(false),
        clearedToTakeOff(false),
@@ -115,6 +119,8 @@ TowerPlaneRec::TowerPlaneRec(const PlaneRec& p) :
 
 TowerPlaneRec::TowerPlaneRec(const SGGeod& pt) :
        planePtr(NULL),
+       eta(0),
+       dist_out(0),
        clearedToLand(false),
        clearedToLineUp(false),
        clearedToTakeOff(false),
@@ -146,6 +152,8 @@ TowerPlaneRec::TowerPlaneRec(const SGGeod& pt) :
 
 TowerPlaneRec::TowerPlaneRec(const PlaneRec& p, const SGGeod& pt) :
        planePtr(NULL),
+       eta(0),
+       dist_out(0),
        clearedToLand(false),
        clearedToLineUp(false),
        clearedToTakeOff(false),
@@ -1497,7 +1505,11 @@ void FGTower::DoRwyDetails() {
        // Based on the airport-id and wind get the active runway
        
   const FGAirport* apt = fgFindAirportID(ident);
-  assert(apt);
+  if (!apt) {
+    SG_LOG(SG_ATC, SG_WARN, "FGTower::DoRwyDetails: unknown ICAO:" << ident);
+    return;
+  }
+  
        FGRunway* runway = apt->getActiveRunwayForUsage();
 
   activeRwy = runway->ident();
@@ -2125,6 +2137,7 @@ void FGTower::VFRArrivalContact(const string& ID, const LandingType& opt) {
        
        t->plane.type = GA_SINGLE;      // FIXME - Another assumption!
        t->plane.callsign = usercall;
+       CalcETA(t);
        
        t->vfrArrivalReported = true;
        responseReqd = true;