Tacan: avoid a 'long-range' wgs84_inverse
- Only check mobile distance at all, if the mobile is valid
This commit is contained in:
parent
34433c1fa1
commit
27c58ddb21
1 changed files with 4 additions and 4 deletions
|
@ -138,7 +138,7 @@ TACAN::update (double delta_time_sec)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SGGeod pos(globals->get_aircraft_position());
|
SGGeod pos(globals->get_aircraft_position());
|
||||||
// On timeout, scan again
|
// On timeout, scan again
|
||||||
_time_before_search_sec -= delta_time_sec;
|
_time_before_search_sec -= delta_time_sec;
|
||||||
if ((_time_before_search_sec < 0 || _new_frequency) && _frequency_mhz >= 0)
|
if ((_time_before_search_sec < 0 || _new_frequency) && _frequency_mhz >= 0)
|
||||||
|
@ -150,10 +150,10 @@ TACAN::update (double delta_time_sec)
|
||||||
double mobile_az2 = 0;
|
double mobile_az2 = 0;
|
||||||
double mobile_bearing = 0;
|
double mobile_bearing = 0;
|
||||||
double mobile_distance = 0;
|
double mobile_distance = 0;
|
||||||
|
if (_mobile_valid) {
|
||||||
geo_inverse_wgs_84(pos, _mobilePos,
|
geo_inverse_wgs_84(pos, _mobilePos,
|
||||||
&mobile_bearing, &mobile_az2, &mobile_distance);
|
&mobile_bearing, &mobile_az2, &mobile_distance);
|
||||||
|
}
|
||||||
|
|
||||||
//calculate the bearing and range of the station from the aircraft
|
//calculate the bearing and range of the station from the aircraft
|
||||||
double az2 = 0;
|
double az2 = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue