Better geometrical slope handling#2
Closed
Ishanarunarjpriya wants to merge 28 commits into
Closed
Conversation
Vehicle modes (isFlying/isShip/isWave/isBird/isDart) must not accumulate slope state — isOnSlope, wasOnSlope, currentSlopeAngle, and slopeVelocity are wiped to 0 before any slope hit results are applied. This prevents the polluting flags from contaminating collision tracking on the next frame, which was causing unexpected player deaths every time a ship/wave/bird/dart-mode touched ground after a slope run.
1. Hazard sorting priority (player.js:2034–2048) Moved _colType === hazardType to the absolute first branch inside _broadPhaseHit so no earlier portal/coin/ring handler 'continue' can skip a death check. Old duplicate block removed from mid-chain. 2. Ball velocity symmetric clamp (player.js:1850) Replaced asymmetric if/else clamped at +/-30 for gravityFlipped only with a single Math.max(-30, Math.min(30, velocity)) that constrains both branches identically, preventing pad-launched balls from entering out-of-bounds clipping bands. 3. QueuedHold release safety (player.js:1812) Added this.p.queuedHold = false inside the _updateFlyJump flight path whenever this.p.upKeyDown reads false and the player is not yet falling, so jump-ring buffered input never fires on a key release frame.
Insert vehicle override (isFlying/isShip/isWave/isBird/isDart) directly inside the slope detection loop, immediately after _floorSlopeHit and _ceilingSlopeHit assignment. This gives the override access to local variables (_surfY, _playerRadOnSlope) and lets it continue past the slope processing. Overrides resolve position, set ground state, wipe slope flags, and nullify the hit object so the post-loop block is skipped for these modes.
- Wave/dart now slide on slopes instead of dying (matching decompiled GD behavior) - Inside-slope death now checks mode type instead of objid restriction
…o better-geometrical-slope-handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.