]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIBallistic.cxx
AIBallistic.cxx: warning fix (initialization order)
[flightgear.git] / src / AIModel / AIBallistic.cxx
index 78ed4cdf0a479809ff6eddb3ac44ebf13ac78241..be5bcd74f3696c8aa6b4292bd281b99b43514815 100644 (file)
@@ -48,10 +48,10 @@ _ht_agl_ft(0.0),
 _azimuth(0.0),
 _elevation(0.0),
 _rotation(0.0),
-_az_random_error(0.0),
-_el_random_error(0.0),
 hs(0),
 _elapsed_time(0),
+_az_random_error(0.0),
+_el_random_error(0.0),
 _aero_stabilised(false),
 _drag_area(0.007),
 _cd(0.029),
@@ -319,7 +319,7 @@ void FGAIBallistic::setDragArea(double a) {
 
 void FGAIBallistic::setLife(double seconds) {
     if (_random)
-        life = seconds * (1 - _life_randomness + 2 * _life_randomness * sg_random());
+        life = seconds * _life_randomness + (seconds * (1 -_life_randomness) * sg_random());
     else
         life = seconds;
 }