1
0
Fork 0

don't use _tgt_rudder uninitialized

This commit is contained in:
mfranz 2007-07-11 10:56:33 +00:00
parent 158bfd1860
commit 94326d14af

View file

@ -283,6 +283,7 @@ void FGAIShip::Run(double dt) {
roll = (raw_roll * _roll_constant) + (roll * (1 - _roll_constant)); roll = (raw_roll * _roll_constant) + (roll * (1 - _roll_constant));
// adjust target _rudder angle if heading lock engaged // adjust target _rudder angle if heading lock engaged
double rudder_diff = 0.0;
if (_hdg_lock) { if (_hdg_lock) {
double rudder_sense = 0.0; double rudder_sense = 0.0;
double diff = fabs(hdg - tgt_heading); double diff = fabs(hdg - tgt_heading);
@ -307,10 +308,9 @@ void FGAIShip::Run(double dt) {
_tgt_rudder = diff * rudder_sense; _tgt_rudder = diff * rudder_sense;
else else
_tgt_rudder = 45 * rudder_sense; _tgt_rudder = 45 * rudder_sense;
}
// adjust _rudder angle rudder_diff = _tgt_rudder - _rudder;
double rudder_diff = _tgt_rudder - _rudder; }
// set the _rudder limit by speed // set the _rudder limit by speed
if (speed <= 40) if (speed <= 40)