Fixed out-of-bounds crash for pathfinding spline algorithm. If the game's window is out-of-bounds when setting the position, the game will try to move the window to an appropriate spot to be on-screen, or to a default location if it has trouble finding a spot. Release Build 8723.

This commit is contained in:
2024-04-08 23:16:34 -05:00
parent 8c759f0367
commit 254b4b3ea0
4 changed files with 57 additions and 6 deletions
+1 -1
View File
@@ -224,7 +224,7 @@ Pathfinding::sPoint2D Pathfinding::sSpline::GetSplinePoint(float t, bool bLooped
}
else
{
p1 = (int)t1;
p1 = std::clamp(size_t(t1),size_t(0),points.size()-1);
p2 = (p1 + 1) % points.size();
p3 = (p2 + 1) % points.size();
p0 = p1 >= 1 ? p1 - 1 : points.size() - 1;