Fix jump snap-down: only ground when velocity is non-positive

Removed the '|| *groundH > feetZ' condition that was snapping player
to ground during upward jumps when ground was above current position.
Now only grounds when vertical velocity is <= 0 (falling or landing),
preventing premature grounding during jump arc.
This commit is contained in:
Kelsi 2026-02-08 20:39:25 -08:00
parent 4ca4d1e509
commit 9090fb8727

View file

@ -541,8 +541,7 @@ void CameraController::update(float deltaTime) {
// WoW-style: snap to floor if within step-up or fall-catch range,
// but only when not moving upward (jumping)
if (dz <= stepUp && dz >= -fallCatch &&
(verticalVelocity <= 0.0f || *groundH > feetZ)) {
if (dz <= stepUp && dz >= -fallCatch && verticalVelocity <= 0.0f) {
targetPos.z = *groundH;
verticalVelocity = 0.0f;
grounded = true;