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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user