Merge branch 'no-spin-jump' into 'next'

Fix a Few Spin Related Bugs (Closes #286 and #360)

Closes #286 and #360

See merge request STJr/SRB2!1256
This commit is contained in:
James R 2020-12-10 15:02:29 -05:00
commit c841750868
3 changed files with 8 additions and 4 deletions

View file

@ -3366,7 +3366,7 @@ void P_MobjCheckWater(mobj_t *mobj)
}
// skipping stone!
if (p && (p->charability2 == CA2_SPINDASH) && p->speed/2 > abs(mobj->momz)
if (p && p->speed/2 > abs(mobj->momz)
&& ((p->pflags & (PF_SPINNING|PF_JUMPED)) == PF_SPINNING)
&& ((!(mobj->eflags & MFE_VERTICALFLIP) && thingtop - mobj->momz > mobj->watertop)
|| ((mobj->eflags & MFE_VERTICALFLIP) && mobj->z - mobj->momz < mobj->waterbottom)))

View file

@ -4503,7 +4503,7 @@ DoneSection2:
P_InstaThrust(player->mo, player->mo->angle, linespeed);
if ((lines[i].flags & ML_EFFECT5) && (player->charability2 == CA2_SPINDASH)) // Roll!
if (lines[i].flags & ML_EFFECT5) // Roll!
{
if (!(player->pflags & PF_SPINNING))
player->pflags |= PF_SPINNING;
@ -4669,7 +4669,7 @@ DoneSection2:
break;
case 7: // Make player spin
if (!(player->pflags & PF_SPINNING) && P_IsObjectOnGround(player->mo) && (player->charability2 == CA2_SPINDASH))
if (!(player->pflags & PF_SPINNING))
{
player->pflags |= PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_PLAY_ROLL);

View file

@ -2329,7 +2329,8 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff)
P_MobjCheckWater(player->mo);
if (player->pflags & PF_SPINNING)
{
if (player->mo->state-states != S_PLAY_ROLL && !(player->pflags & PF_STARTDASH))
if (!(player->pflags & PF_STARTDASH) && player->panim != PA_ROLL && player->panim != PA_ETC
&& player->panim != PA_ABILITY && player->panim != PA_ABILITY2)
{
P_SetPlayerMobjState(player->mo, S_PLAY_ROLL);
S_StartSound(player->mo, sfx_spin);
@ -4524,6 +4525,9 @@ void P_DoJump(player_t *player, boolean soundandstate)
player->mo->eflags &= ~MFE_APPLYPMOMZ;
player->pflags |= P_GetJumpFlags(player);;
if (player->charflags & SF_NOJUMPDAMAGE)
player->pflags &= ~PF_SPINNING;
if (soundandstate)
{