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:
Jump onto the moving platform
Right before you pass under the edge of the ceiling, crouch -> stand -> attack
Another test is to hit down + up very fast right near the edge too
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.
I am no good at being able to replicate the issue in the first place, but the code makes sense to me so I'd be willing to accept this in its current state. If no one else chimes in we can merge this.
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.