Fix floorclip

This commit is contained in:
Erimel committed 2026-10-06 17:15:37 -04:00
1 parent ac6b6b85a2
commit bacf9b09c7
1 file changed
+2 -2
@@ -25,13 +25,13 @@ class FloorClipTargetProcessor(
val parentTargetY = mutableIkTargets[parentPart] ?: fk[parentPart]?.tailPosition ?: continue
// Offset the parent target by the lowest child as well so that none of its active children are under the floor either.
var lowestChildTargetY = parentTargetY.y
var lowestChildTargetY = 0f
for ((_, childPart) in iterateBodyPartHierarchy(parentPart, true)) {
if (inputSkeleton[childPart]?.isRotationActive == false) continue
val target = mutableIkTargets[childPart] ?: fk[childPart]?.tailPosition ?: continue
if (target.y < lowestChildTargetY) lowestChildTargetY = target.y
}
val childOffset = (parentTargetY.y - lowestChildTargetY).coerceAtLeast(0f)
val childOffset = if (lowestChildTargetY < 0f) (parentTargetY.y - lowestChildTargetY).coerceAtLeast(0f) else 0f
// Snap the parent up.
val targetY = parentTargetY.y.coerceAtLeast(floorLevel) + childOffset