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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ public:
|
||||||
// Environment
|
// Environment
|
||||||
time_t cur_time; // current unix time
|
time_t cur_time; // current unix time
|
||||||
long int warp; // offset in seconds to unix time
|
long int warp; // offset in seconds to unix time
|
||||||
float visibility; // visibility in meters (for env. effects)
|
float visibility; // visibility in meters (for env. effects)
|
||||||
|
|
||||||
// Control surface positions (normalized values)
|
// Control surface positions (normalized values)
|
||||||
float elevator;
|
float elevator;
|
||||||
|
|
Loading…
Add table
Reference in a new issue