Push bouncing players backwards if they get stuck in a wall
Steps to reproduce: See attached file for replays. These should be ran in an EXE based off 1.0.1 but with the position resyncing disabled. (See part of the first commit)
Expected behavior: You should get properly bumped off of those walls in each replay
Actual behavior: You get stuck indefinitely
Cause:
The P_TryMove
call at the end of P_BouncePlayerMove
is failing, presumably since the movement would send the player into a wall
Solution:
Store the player's original X/Y momentum before running bounce logic, and if the P_TryMove
call at the end returns false, move the player backwards by that stored momentum
Attached ZIP contains an EXE compiled against the first commit on this branch (for disabling replay resyncs, and some debugging prints) as well as three sample replays that each get stuck within one minute without this fix.