Skip to content

Add proper parameters to MobjMoveBlocked so you can actually tell what you're being blocked by (Resolves #332)

SMS Alfredo requested to merge SMS_Alfredo/SRB2:youvebeenblocked into next

So, when editing P_CheckSkyHit for !1472 (closed), I realized that the original version of the function didn't have any sort of parameter to tell you what line the function was checking, despite there somehow being a ceilingline there anyways. This was actually because ceilingline is actually a global variable set by the collision code to be used within the collision code. However, it's described as being there to "keep track of the line that lowers the ceiling", which may end up having some really odd quirks to it. But right next to it was blockingline, which sounded to me like a perfect candidate to fixing the whole lack of parameters for MobjMoveBlocked issue. And I had remembered !1348 (merged) fixing an issue with a variable that sounded extremely similar to blockingline, so I was able to add in tmhitthing as well.

This merge request adds in two new parameters to the MobjMoveBlocked hook, thing and line, that parse through tmhitthing and blockingline respectively. They give you the last mobj and the last line that mo had been blocked by while trying to move using P_TryMove.

Use this lua and this exe to test this merge request. The player will directly face away from whatever object or wall they're colliding with, and information about the collision will be printed in console.

srb20028

Edited by sphere

Merge request reports