1
0
Fork 0

Work around for the AI-traffic due to precision issues generated by the radio frequency dialog

This commit is contained in:
daveluff 2004-03-15 11:14:03 +00:00
parent c37874e140
commit 1347ca930f

View file

@ -92,7 +92,12 @@ void FGAIPlane::Update(double dt) {
_max_count = 5.0; // FIXME - hardwired length of message - need to calculate it!
//cout << "Transmission = " << pending_transmission << '\n';
if(freq == user_freq0 || freq == user_freq1) {
// The radios dialog seems to set slightly imprecise freqs, eg 118.099998
// The eplison stuff below is a work-around
double eps0 = fabs(freq - user_freq0);
double eps1 = fabs(freq - user_freq1);
if(eps0 < 0.002 || eps1 < 0.002) {
//cout << "Transmitting..." << endl;
// we are on the same frequency, so check distance to the user plane
if(1) {