From 7e8ee5a3a86ada7050b7255309ee044cebf21051 Mon Sep 17 00:00:00 2001 From: Christian Schmitt Date: Fri, 7 Feb 2014 23:29:06 +0100 Subject: [PATCH] fix another crash at the poles --- src/Instrumentation/tacan.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Instrumentation/tacan.cxx b/src/Instrumentation/tacan.cxx index 8b3fff699..d1606b8e9 100644 --- a/src/Instrumentation/tacan.cxx +++ b/src/Instrumentation/tacan.cxx @@ -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) { -- 2.39.5