From: Christian Schmitt Date: Fri, 7 Feb 2014 22:29:06 +0000 (+0100) Subject: fix another crash at the poles X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7e8ee5a3a86ada7050b7255309ee044cebf21051;p=flightgear.git fix another crash at the poles --- 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) {