Skip to content

Commit a4de5b8

Browse files
committed
Fixed wonky crouch amount calculations
1 parent 21a3e9f commit a4de5b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Entities/AHuman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ void AHuman::UpdateCrouching() {
14201420
}
14211421

14221422
float finalWalkPathYOffset = std::clamp(Lerp(0.0F, 1.0F, -m_WalkPathOffset.m_Y, desiredWalkPathYOffset, 0.3F), 0.0F, m_MaxWalkPathCrouchShift);
1423-
m_CrouchAmount = std::clamp(finalWalkPathYOffset / m_MaxWalkPathCrouchShift - 0.5F, 0.0F, 1.0F); // because it's lerped, it never hits 1 exactly. thus the -0.5F
1423+
m_CrouchAmount = std::clamp(finalWalkPathYOffset / (m_MaxWalkPathCrouchShift - 0.1f), 0.0F, 1.0F); // because it's lerped, it never hits 1 exactly. thus the -0.1F
14241424
m_WalkPathOffset.m_Y = -finalWalkPathYOffset;
14251425

14261426
// Adjust our X offset to try to keep our legs under our centre-of-mass

0 commit comments

Comments
 (0)