player/player.go: Only deal fall damage on an actual vertical collision#1283
player/player.go: Only deal fall damage on an actual vertical collision#1283root-nat wants to merge 1 commit into
Conversation
The on-ground check used for fall damage extends the player bounding box along the movement of the tick, reporting a landing as soon as it intersects any block. While falling next to a block at the side, that intersection registered a landing in mid-air, dealing premature fall damage and clearing the accumulated fall distance. Also require a vertical collision on the tick before applying the damage. A real landing always truncates the downward movement, whereas brushing a block sideways does not, so the fall distance keeps accumulating until the player actually reaches the ground. Fixes df-mc#1003. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
We should fix the on ground being set to true when falling past blocks rather than this |
|
Thanks for the steer — agreed, patching I've reworked it to fix .Extend(mgl64.Vec3{0, -0.05}).Extend(mgl64.Vec3{0, math.Min(deltaPos[1], 0)})A block at the side is no longer mistaken for ground, while a stepped or fast descent still finds the ground beneath the footprint, so the sprinting-down-stairs fix from #1044 should hold (the 0.6-wide footprint always straddles the step it is leaving, and the descent term keeps the downward reach in step with the gap). The idle-tick call, which passes a zero delta, is unchanged. Does this match what you had in mind? If so I'll reopen with it — I'll give the stairs/slabs case a run in-game first either way. |
|
Continued in #1286 with the root-cause |
Problem
When a player falls close to a block at its side it takes premature fall damage (#1003). The cause is
checkOnGround: it extended the probe box opposite to the whole movement (deltaPos.Mul(-1.0)), which while falling pushes the box upwards and sideways, so a block next to the fall path intersects it and the player is wrongly reported on the ground.Fix
Extend the probe straight down only — by 0.05 plus the tick's descent — keeping the player's exact horizontal footprint:
A block at the side is no longer mistaken for ground, while a stepped or fast descent still finds the ground beneath the footprint.
updateFallStateis left untouched. This is the root-cause fix suggested in the previous review, rather than patching the fall-damage path.Testing
Verified in-game on 1.26.30:
Fixes #1003.
🤖 Generated with Claude Code