1
0
Fork 0

fix another crash at the poles

This commit is contained in:
Christian Schmitt 2014-02-07 23:29:06 +01:00
parent 6cadc2cf40
commit 7e8ee5a3a8

View 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) {