]> git.mxchange.org Git - flightgear.git/commitdiff
fix another crash at the poles
authorChristian Schmitt <chris@ilovelinux.de>
Fri, 7 Feb 2014 22:29:06 +0000 (23:29 +0100)
committerChristian Schmitt <chris@ilovelinux.de>
Fri, 7 Feb 2014 22:29:06 +0000 (23:29 +0100)
src/Instrumentation/tacan.cxx

index 8b3fff699791bad2b30e8d4b9d3d8ae10ab87e3e..d1606b8e93e188eef8f9a21c1de4de5330c50ad1 100644 (file)
@@ -68,8 +68,7 @@ TACAN::~TACAN ()
 void
 TACAN::init ()
 {
-    string branch;
-    branch = "/instrumentation/" + _name;
+    string branch = "/instrumentation/" + _name;
 
     SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
 
@@ -159,10 +158,10 @@ TACAN::update (double delta_time_sec)
     double az2 = 0;
     double bearing = 0;
     double distance = 0;
-
-    geo_inverse_wgs_84(pos, _transmitter_pos,
-                       &bearing, &az2, &distance);
-
+    if (_transmitter_valid) {
+        geo_inverse_wgs_84(pos, _transmitter_pos,
+                           &bearing, &az2, &distance);
+    }
 
     //select the nearer
     if ( mobile_distance <= distance && _mobile_valid) {