From be5184a8cc19b7ca0fb129e32e73ece6837ae421 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 26 Jul 2017 16:34:33 +0100 Subject: [PATCH] ...fixed some weirdness with spinning I accidentially introduced in an attempt to fix it. --- src/p_user.c | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 28646d0ca..002a6fda0 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5028,18 +5028,20 @@ static void P_3dMovement(player_t *player) { movepushforward = cmd->forwardmove * (thrustfactor * acceleration); - // allow very small movement while in air for gameplay - if (!onground) - movepushforward >>= 2; // proper air movement // Allow a bit of movement while spinning - else if (player->pflags & PF_SPINNING) + if (player->pflags & PF_SPINNING) { if ((mforward && cmd->forwardmove > 0) || (mbackward && cmd->forwardmove < 0) || (player->pflags & PF_STARTDASH)) movepushforward = 0; - else + else if (onground) movepushforward >>= 4; + else + movepushforward >>= 3; } + // allow very small movement while in air for gameplay + else if (!onground) + movepushforward >>= 2; // proper air movement movepushforward = FixedMul(movepushforward, player->mo->scale); @@ -5067,18 +5069,20 @@ static void P_3dMovement(player_t *player) movepushforward = max(abs(cmd->sidemove), abs(cmd->forwardmove)) * (thrustfactor * acceleration); - // allow very small movement while in air for gameplay - if (!onground) - movepushforward >>= 2; // proper air movement // Allow a bit of movement while spinning - else if (player->pflags & PF_SPINNING) + if (player->pflags & PF_SPINNING) { if ((mforward && cmd->forwardmove > 0) || (mbackward && cmd->forwardmove < 0) || (player->pflags & PF_STARTDASH)) movepushforward = 0; - else + else if (onground) movepushforward >>= 4; + else + movepushforward >>= 3; } + // allow very small movement while in air for gameplay + else if (!onground) + movepushforward >>= 2; // proper air movement movepushsideangle = controldirection; @@ -5096,25 +5100,26 @@ static void P_3dMovement(player_t *player) { movepushside = cmd->sidemove * (thrustfactor * acceleration); + // allow very small movement while in air for gameplay if (!onground) { - movepushside >>= 2; - + movepushside >>= 2; // proper air movement // Reduce movepushslide even more if over "max" flight speed - if (player->powers[pw_tailsfly] && player->speed > topspeed) + if ((player->pflags & PF_SPINNING) || (player->powers[pw_tailsfly] && player->speed > topspeed)) movepushside >>= 2; } - // Allow a bit of movement while spinning - if (player->pflags & PF_SPINNING) + else if (player->pflags & PF_SPINNING) { - if ((player->pflags & PF_STARTDASH)) + if (player->pflags & PF_STARTDASH) movepushside = 0; + else if (onground) + movepushside >>= 4; else - movepushside = FixedDiv(movepushside,16*FRACUNIT); + movepushside >>= 3; } - // Finally move the player now that his speed/direction has been decided. + // Finally move the player now that their speed/direction has been decided. movepushside = FixedMul(movepushside, player->mo->scale); #ifdef ESLOPE