USplineComponent::GetInputKeyAtDistanceAlongSpline is wrong

Well, the easiest example I can come up with: create a spline.

First call the function GetLocationAtDistanceAlongSpline() for a distance value > 0, maybe spline length is the best.

After that call GetInputKeyAtDistanceAlongSpline() for the same distance, and use the return value to call GetLocationAtSplineInputKey().

The two locations are different.

My actual example I had trouble with is pretty complicated - I use the function to calculate the distance value for the closest spline point from a given world location. I can get the inputkey value, I have to calculate the distance from that, I use logarithmic search to get the distance.

However as the inputkey goes from the beginning of the spline until the end, the calculated distance does not go between 0 and SplineLength, it covers a smaller segment. Multiplying the return value of GetInputKeyAtDistanceAlongSpline() with NumPoints-1 fixes it (as long as the duration is 1.0f and the spline is not closed).