X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FEnvironment%2Fridge_lift.cxx;h=bb461216de5626af37a74b7c3f6584fce00ad422;hb=9745a6fce3de367cf29c37829b312090e84c2487;hp=3b675a93ff686f3d4c3eef285018f8fda05fa1da;hpb=556885e55327339f3b2147d0ecaf713921506482;p=flightgear.git diff --git a/src/Environment/ridge_lift.cxx b/src/Environment/ridge_lift.cxx index 3b675a93f..bb461216d 100644 --- a/src/Environment/ridge_lift.cxx +++ b/src/Environment/ridge_lift.cxx @@ -35,7 +35,7 @@ #include
#include #include -#include +#include #include using std::string; @@ -53,7 +53,8 @@ const double FGRidgeLift::dist_probe_m[] = { // in meters }; //constructor -FGRidgeLift::FGRidgeLift () +FGRidgeLift::FGRidgeLift () : + lift_factor(0.0) { strength = 0.0; timer = 0.0; @@ -187,8 +188,8 @@ void FGRidgeLift::update(double dt) { //boundaries double boundary2_m = 130.0; // in the lift if (lift_factor < 0.0) { // in the sink - double highest_probe_temp= max ( probe_elev_m[1], probe_elev_m[2] ); - double highest_probe_downwind_m= max ( highest_probe_temp, probe_elev_m[3] ); + double highest_probe_temp= std::max ( probe_elev_m[1], probe_elev_m[2] ); + double highest_probe_downwind_m= std::max ( highest_probe_temp, probe_elev_m[3] ); boundary2_m = highest_probe_downwind_m - probe_elev_m[0]; } @@ -199,7 +200,7 @@ void FGRidgeLift::update(double dt) { agl_factor = 1.0; } else { agl_factor = exp(-(2 + probe_elev_m[0] / 2000) * - (user_altitude_agl_m - boundary2_m) / max(probe_elev_m[0],200.0)); + (user_altitude_agl_m - boundary2_m) / std::max(probe_elev_m[0],200.0)); } double ground_wind_speed_mps = _surface_wind_speed_node->getDoubleValue() * SG_NM_TO_METER / 3600;