From ba652864a6394198b9ddfb55b114297fe76504fc Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 4 Feb 2017 17:08:14 +0000 Subject: [PATCH] Revamped roll-on-landing to work even from jumping, for the purposes of slopes! (But not from PF_THOKKED.) Salt has wanted this for a while, and this was the only branch I had open which it was appropriate for. :P --- src/p_mobj.c | 10 +++++++--- src/p_user.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 04655814c..fa59f7663 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3322,9 +3322,13 @@ static void P_PlayerZMovement(mobj_t *mo) } } - if (mo->player->pflags & PF_JUMPED) - mo->player->pflags &= ~PF_SPINNING; - else if (!(mo->player->pflags & PF_USEDOWN)) + if ((mo->player->charability2 == CA2_SPINDASH) && !(mo->player->pflags & PF_THOKKED) && (mo->player->cmd.buttons & BT_USE) && (FixedHypot(mo->momx, mo->momy) > (5*mo->scale))) + { + mo->player->pflags |= PF_SPINNING; + P_SetPlayerMobjState(mo, S_PLAY_SPIN); + S_StartSound(mo, sfx_spin); + } + else mo->player->pflags &= ~PF_SPINNING; if (!(mo->player->pflags & PF_GLIDING)) diff --git a/src/p_user.c b/src/p_user.c index 662479a89..7ea32612e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3843,7 +3843,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) } } - // If not moving up or down, and travelling faster than a speed of four while not holding + // If not moving up or down, and travelling faster than a speed of five while not holding // down the spin button and not spinning. // AKA Just go into a spin on the ground, you idiot. ;) else if ((cmd->buttons & BT_USE || ((twodlevel || (player->mo->flags2 & MF2_TWOD)) && cmd->forwardmove < -20))