...fixed some weirdness with spinning I accidentially introduced in an attempt to fix it.

This commit is contained in:
toasterbabe 2017-07-26 16:34:33 +01:00
parent 672bcc349c
commit be5184a8cc

View file

@ -5028,18 +5028,20 @@ static void P_3dMovement(player_t *player)
{ {
movepushforward = cmd->forwardmove * (thrustfactor * acceleration); 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 // 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) if ((mforward && cmd->forwardmove > 0) || (mbackward && cmd->forwardmove < 0)
|| (player->pflags & PF_STARTDASH)) || (player->pflags & PF_STARTDASH))
movepushforward = 0; movepushforward = 0;
else else if (onground)
movepushforward >>= 4; 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); 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); 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 // 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) if ((mforward && cmd->forwardmove > 0) || (mbackward && cmd->forwardmove < 0)
|| (player->pflags & PF_STARTDASH)) || (player->pflags & PF_STARTDASH))
movepushforward = 0; movepushforward = 0;
else else if (onground)
movepushforward >>= 4; movepushforward >>= 4;
else
movepushforward >>= 3;
} }
// allow very small movement while in air for gameplay
else if (!onground)
movepushforward >>= 2; // proper air movement
movepushsideangle = controldirection; movepushsideangle = controldirection;
@ -5096,25 +5100,26 @@ static void P_3dMovement(player_t *player)
{ {
movepushside = cmd->sidemove * (thrustfactor * acceleration); movepushside = cmd->sidemove * (thrustfactor * acceleration);
// allow very small movement while in air for gameplay
if (!onground) if (!onground)
{ {
movepushside >>= 2; movepushside >>= 2; // proper air movement
// Reduce movepushslide even more if over "max" flight speed // 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; movepushside >>= 2;
} }
// Allow a bit of movement while spinning // 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; movepushside = 0;
else if (onground)
movepushside >>= 4;
else 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); movepushside = FixedMul(movepushside, player->mo->scale);
#ifdef ESLOPE #ifdef ESLOPE