Revise conditions under which players use spinheight and enter gaps:

- players with SF_NOJUMPDAMAGE but *not* SF_NOJUMPSPIN now always use spinheight while jumping (i.e. even with PF_NOJUMPDAMAGE), as long as their panim is PA_JUMP or PA_ROLL
- players with SF_NOJUMPSPIN no longer use spinheight while jumping (but,)
- PA_ROLL is now an acceptable condition for using spinheight (but not for entering gaps, e.g. S3K shields will shrink the hitbox but not allow gap entry on their own)
- flying players now only use spinheight if they do not have SF_NOJUMPSPIN (you're welcome, EggpackRE)
- players with neither SF_NOJUMPSPIN nor SF_NOJUMPDAMAGE use the same conditions as in 2.2.9 prerelease, i.e. use spinheight and can enter gaps unless they have PF_NOJUMPDAMAGE
This commit is contained in:
lachablock 2021-03-25 15:09:04 +11:00
parent 0405b3922c
commit f99d89742a

View file

@ -12949,11 +12949,18 @@ boolean P_PlayerFullbright(player_t *player)
&& player->mo->state < &states[S_PLAY_NIGHTS_TRANS6])))); // Note the < instead of <=
}
#define JUMPCURLED(player) ((player->pflags & PF_JUMPED)\
&& (!(player->charflags & SF_NOJUMPSPIN))\
&& (!(player->pflags & PF_NOJUMPDAMAGE)\
|| ((player->charflags & SF_NOJUMPDAMAGE)\
&& (player->panim == PA_JUMP || player->panim == PA_ROLL))))\
// returns true if the player can enter a sector that they could not if standing at their skin's full height
boolean P_PlayerCanEnterSpinGaps(player_t *player)
{
return ((player->pflags & (PF_SPINNING|PF_GLIDING))
|| (player->charability == CA_GLIDEANDCLIMB && player->mo->state-states == S_PLAY_GLIDE_LANDING));
return ((player->pflags & (PF_SPINNING|PF_GLIDING)) // players who are spinning or gliding
|| (player->charability == CA_GLIDEANDCLIMB && player->mo->state-states == S_PLAY_GLIDE_LANDING) // players who are landing from a glide
|| JUMPCURLED(player)); // players who are jumpcurled, but only if they would normally jump that way
}
// returns true if the player should use their skin's spinheight instead of their skin's height
@ -12961,7 +12968,7 @@ boolean P_PlayerShouldUseSpinHeight(player_t *player)
{
return (P_PlayerCanEnterSpinGaps(player)
|| (player->mo->state == &states[player->mo->info->painstate])
|| ((player->pflags & PF_JUMPED) && !(player->pflags & PF_NOJUMPDAMAGE))
|| player->powers[pw_tailsfly]
|| (player->charability == CA_FLY && player->mo->state-states == S_PLAY_FLY_TIRED));
|| (player->panim == PA_ROLL)
|| ((player->powers[pw_tailsfly] || (player->charability == CA_FLY && player->mo->state-states == S_PLAY_FLY_TIRED))
&& !(player->charflags & SF_NOJUMPSPIN)));
}