Addresses two common collision issues #2584
Merged
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.
The first is when you attack soon after crouching. If you timed it just right, attacking just before you went under a low ceiling would cause you to stand up and clip into the ceiling.
The second, which is related to the first, would happen if you stood up right at the edge of a ceiling. The code would find a tile above the character instead of below, since even when standing still, gravity causes the collision code to run assuming you're falling down.
Both of these situations are easiest to reproduce when on a moving platform.
I tested this extensively with
--level=black-caverns-2 --cheat=give_master_key
:I'd suggest trying to cause it in the current version of the game, so you get the key presses that cause the issue
Attempts to address #2578 and #2456.
For #2578, I'm not sure how to have a repeatable test with being hit by a bat to knock you into the ceiling.
Also note that I'm testing at 144FPS and I think it's easier to reproduce at a lower framerate.