Skip to content

Do not let SF_NOJUMPSPIN characters enter sectors they could not enter if standing at full height (Closes #457)

Lach requested to merge playercanenterspingaps into next

#457 (closed) is a bit of a concern for mappers right now; here's my attempt at a hopefully elegant solution!

Characters with SF_NOJUMPSPIN will only jump with spinheight in midair if using the PA_ROLL panim. They are not allowed gap passage while jumping. They may still enter gaps if spinning or gliding, however.

Characters without SF_NOJUMPSPIN will jump with spinheight in midair if using the PA_JUMP or PA_ROLL panims, and are allowed gap passage while this is the case. PF_NOJUMPDAMAGE no longer has any effect on player height.

Most custom characters should not need adjustments. To make hitbox control easier, two new Lua hooks have been added:

"PlayerHeight": function(player), returns a fixed-point number which the player object's height will be set to. If the function returns nil or a negative value, the game will use default checks to determine player height (i.e. via P_PlayerShouldUseSpinHeight).

"PlayerCanEnterSpinGaps": function(player), returns a boolean which can forcibly allow or block gap passage. Returning true allows players to fit into any gap that is larger than their mobj's height field, and returning false prevents players from fitting into any gap that is smaller than their skin's height field (scaled).

(Example script: testheight.lua)

gif2 gif3

Edited by Lach

Merge request reports