From 88a8a09516a6b117b80b70bee785799302c97226 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 26 Oct 2020 01:54:15 -0700 Subject: [PATCH] Make sneaker panels push you in spinout AGAIN LOL The old condition for player movement was... 1. player hasn't finished 2. player not in pain, or player in pain but on the ground The else condition to this is therefore player has finished or player in pain and in the air. I believe K_MomentumToFacing (prior to bots) was only for letting the player turn around after crossing the finish line, to face the camera. (K_MomentumToFacing also does nothing in the air.) --- src/k_kart.c | 4 +--- src/k_kart.h | 2 +- src/p_user.c | 28 +++++++++++++--------------- 3 files changed, 15 insertions(+), 19 deletions(-) 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!