diff --git a/src/game/client/render_map.cpp b/src/game/client/render_map.cpp index b438d8b1e3b..c613bf8ae28 100644 --- a/src/game/client/render_map.cpp +++ b/src/game/client/render_map.cpp @@ -124,16 +124,6 @@ const CEnvPointBezier *CMapBasedEnvelopePointAccess::GetBezier(int Index) const return nullptr; } -static double CubicRoot(double x) -{ - if(x == 0.0) - return 0.0; - else if(x < 0.0) - return -std::exp(std::log(-x) / 3.0); - else - return std::exp(std::log(x) / 3.0); -} - static float SolveBezier(float x, float p0, float p1, float p2, float p3) { const double x3 = -p0 + 3.0 * p1 - 3.0 * p2 + p3; @@ -193,12 +183,12 @@ static float SolveBezier(float x, float p0, float p1, float p2, float p3) { // only one 'real' solution const double s = std::sqrt(D); - return CubicRoot(s - q) - CubicRoot(s + q) - sub; + return std::cbrt(s - q) - std::cbrt(s + q) - sub; } else if(D == 0.0) { // one single, one double solution or triple solution - const double s = CubicRoot(-q); + const double s = std::cbrt(-q); const double t = 2.0 * s - sub; if(0.0 <= t && t <= 1.0001)