Do a santity check in case net->course_deviation_deg is bogus.
This commit is contained in:
parent
c5110a3650
commit
ae1470d3d1
2 changed files with 7 additions and 1 deletions
|
@ -169,6 +169,12 @@ void FGProps2NetGUI( FGNetGUI *net ) {
|
||||||
net->course_deviation_deg
|
net->course_deviation_deg
|
||||||
= current_radiostack->get_navcom1()->get_nav_reciprocal_radial()
|
= current_radiostack->get_navcom1()->get_nav_reciprocal_radial()
|
||||||
- current_radiostack->get_navcom1()->get_nav_target_radial();
|
- current_radiostack->get_navcom1()->get_nav_target_radial();
|
||||||
|
if ( net->course_deviation_deg < -1000.0
|
||||||
|
|| net->course_deviation_deg > 1000.0 )
|
||||||
|
{
|
||||||
|
// Sanity check ...
|
||||||
|
net->course_deviation_deg = 0.0;
|
||||||
|
}
|
||||||
while ( net->course_deviation_deg > 180.0 ) {
|
while ( net->course_deviation_deg > 180.0 ) {
|
||||||
net->course_deviation_deg -= 360.0;
|
net->course_deviation_deg -= 360.0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue