diff --git a/src/k_kart.c b/src/k_kart.c index a6beddbbe..8a3597f1f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2309,7 +2309,7 @@ SINT8 K_GetForwardMove(player_t *player) return forwardmove; } -fixed_t K_3dKartMovement(player_t *player, boolean onground) +fixed_t K_3dKartMovement(player_t *player) { const fixed_t accelmax = 4000; const fixed_t p_speed = K_GetKartSpeed(player, true); @@ -2319,8 +2319,6 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground) fixed_t orig = ORIG_FRICTION; SINT8 forwardmove = K_GetForwardMove(player); - if (!onground) return 0; // If the player isn't on the ground, there is no change in speed - if (K_PlayerUsesBotMovement(player)) { orig = K_BotFrictionRubberband(player, ORIG_FRICTION); diff --git a/src/k_kart.h b/src/k_kart.h index d45a69570..2c1236368 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -84,7 +84,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower); fixed_t K_GetKartAccel(player_t *player); UINT16 K_GetKartFlashing(player_t *player); SINT8 K_GetForwardMove(player_t *player); -fixed_t K_3dKartMovement(player_t *player, boolean onground); +fixed_t K_3dKartMovement(player_t *player); boolean K_PlayerEBrake(player_t *player); void K_AdjustPlayerFriction(player_t *player); void K_MoveKartPlayer(player_t *player, boolean onground); diff --git a/src/p_user.c b/src/p_user.c index 060709ac7..a6717d212 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1930,26 +1930,24 @@ static void P_3dMovement(player_t *player) K_AdjustPlayerFriction(player); // Forward movement - if (!P_PlayerInPain(player)) + // If the player isn't on the ground, there is no change in speed + // Smiley Face + if (onground) { - if (onground) + movepushforward = K_3dKartMovement(player); + + if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration... + movepushforward = FixedMul(movepushforward, player->mo->movefactor); + + totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward); + totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward); + + if (K_PlayerUsesBotMovement(player) == true) { - movepushforward = K_3dKartMovement(player, onground); - - if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration... - movepushforward = FixedMul(movepushforward, player->mo->movefactor); - - totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward); - totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward); + K_MomentumToFacing(player); } } - if ((!P_PlayerInPain(player) && !onground) - || (K_PlayerUsesBotMovement(player) == true)) - { - K_MomentumToFacing(player); - } - if ((totalthrust.x || totalthrust.y) && player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) > FRACUNIT/2) { // Factor thrust to slope, but only for the part pushing up it!