Fix typo in tangent() function that could cause wrong trajectory calculations

The condition `if (x <= 100000.0f)` should be `if (x <= -100000.0f)` to properly
handle negative extreme values from tan(). This bug could cause incorrect spell
trajectory calculations which may lead to visual glitches or unexpected behavior
on the client side.

Co-authored-by: FrancescoBorzi <75517+FrancescoBorzi@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-25 21:12:34 +00:00
parent 85cc94571b
commit d474bc87b4

View file

@ -1869,7 +1869,7 @@ float tangent(float x)
//if (x <= -std::numeric_limits<float>::max()) return -std::numeric_limits<float>::max(); //if (x <= -std::numeric_limits<float>::max()) return -std::numeric_limits<float>::max();
if (x < 100000.0f && x > -100000.0f) return x; if (x < 100000.0f && x > -100000.0f) return x;
if (x >= 100000.0f) return 100000.0f; if (x >= 100000.0f) return 100000.0f;
if (x <= 100000.0f) return -100000.0f; if (x <= -100000.0f) return -100000.0f;
return 0.0f; return 0.0f;
} }