diff --git a/src/k_kart.c b/src/k_kart.c index 96f022dc1..dd191442a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3921,7 +3921,7 @@ void K_StumblePlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_KART_SPINOUT); // Reset slope. - player->mo->pitch = player->mo->roll = 0; + P_ResetPitchRoll(player->mo); } boolean K_CheckStumble(player_t *player, angle_t oldPitch, angle_t oldRoll, boolean fromAir) @@ -3939,6 +3939,14 @@ boolean K_CheckStumble(player_t *player, angle_t oldPitch, angle_t oldRoll, bool return false; } + if (fromAir && player->airtime < STUMBLE_AIRTIME + && player->airtime > 1) // ACHTUNG HACK, sorry. Ground-to-ground transitions sometimes have 1-tic airtime because collision blows + { + // Short airtime with no reaction window, probably a track traversal setpiece. + // Don't punish for these. + return false; + } + if ((player->mo->pitch == oldPitch) && (player->mo->roll == oldRoll)) { @@ -4102,6 +4110,9 @@ void K_UpdateStumbleIndicator(player_t *player) mobj->renderflags &= ~RF_HORIZONTALFLIP; } + if (air && player->airtime < STUMBLE_AIRTIME) + delta = 0; + steepRange = ANGLE_90 - steepVal; delta = max(0, abs(delta) - ((signed)steepVal)); trans = ((FixedDiv(AngleFixed(delta), AngleFixed(steepRange)) * (NUMTRANSMAPS - 2)) + (FRACUNIT/2)) / FRACUNIT; @@ -4252,7 +4263,7 @@ static void K_HandleTumbleBounce(player_t *player) player->tumbleHeight = 10; player->pflags |= PF_TUMBLELASTBOUNCE; player->mo->rollangle = 0; // p_user.c will stop rotating the player automatically - player->mo->pitch = player->mo->roll = 0; // Prevent Kodachrome Void infinite + P_ResetPitchRoll(player->mo); // Prevent Kodachrome Void infinite } } @@ -6155,8 +6166,7 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) mo->momz = FixedDiv(mo->momz, FixedSqrt(3*FRACUNIT)); } - mo->pitch = 0; - mo->roll = 0; + P_ResetPitchRoll(mo); if (sound) { @@ -8256,7 +8266,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->incontrol = 0; player->incontrol++; } - + player->incontrol = min(player->incontrol, 5*TICRATE); player->incontrol = max(player->incontrol, -5*TICRATE); @@ -10444,6 +10454,7 @@ static void K_KartSpindash(player_t *player) // Update fastfall. player->fastfall = player->mo->momz; player->spindash = 0; + P_ResetPitchRoll(player->mo); if (player->fastfallBase == 0) { diff --git a/src/k_kart.h b/src/k_kart.h index e0bcabf06..e33580f81 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -40,8 +40,10 @@ Make sure this matches the actual number of states #define RR_PROJECTILE_FUSE (8*TICRATE) -#define STUMBLE_STEEP_VAL ANG60 -#define STUMBLE_STEEP_VAL_AIR (ANG30 + ANG10) +// 2023-08-26 +ang20 to Sal's OG values to make them friendlier - Tyron +#define STUMBLE_STEEP_VAL (ANG60 + ANG20) +#define STUMBLE_STEEP_VAL_AIR (ANG30 + ANG10 + ANG20) +#define STUMBLE_AIRTIME TICRATE #define MAXRINGVOLUME 255 #define MINRINGVOLUME 100 diff --git a/src/objects/dash-rings.c b/src/objects/dash-rings.c index 527157cb1..d40e341bb 100644 --- a/src/objects/dash-rings.c +++ b/src/objects/dash-rings.c @@ -161,6 +161,7 @@ static void DashRingLaunch(player_t *player, mobj_t *ring) player->dashRingPushTics = DASHRING_PUSH_TICS; player->mo->rollangle = 0; + P_ResetPitchRoll(player->mo); player->flashing = 0; player->fastfall = 0; K_TumbleInterrupt(player); diff --git a/src/p_local.h b/src/p_local.h index eaf1d6349..ba3f65438 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -569,6 +569,7 @@ void P_ExplodeMissile(mobj_t *mo); void P_CheckGravity(mobj_t *mo, boolean affect); void P_SetPitchRollFromSlope(mobj_t *mo, pslope_t *slope); void P_SetPitchRoll(mobj_t *mo, angle_t pitch, angle_t yaw); +void P_ResetPitchRoll(mobj_t *mo); fixed_t P_ScaleFromMap(fixed_t n, fixed_t scale); fixed_t P_GetMobjHead(const mobj_t *); fixed_t P_GetMobjFeet(const mobj_t *); diff --git a/src/p_mobj.c b/src/p_mobj.c index bdd82d6cc..7a86266ef 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1333,7 +1333,7 @@ void P_SetPitchRollFromSlope(mobj_t *mo, pslope_t *slope) } else { - mo->pitch = mo->roll = 0; + P_ResetPitchRoll(mo); } } @@ -1348,6 +1348,15 @@ void P_SetPitchRoll(mobj_t *mo, angle_t pitch, angle_t yaw) mo->pitch = FixedMul(pitch, FINECOSINE (yaw)); } +// +// P_ResetPitchRoll +// +void P_ResetPitchRoll(mobj_t *mo) +{ + mo->pitch = 0; + mo->roll = 0; +} + #define STOPSPEED (FRACUNIT) // @@ -7191,7 +7200,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) } case MT_FLOATINGITEM: { - mobj->pitch = mobj->roll = 0; + P_ResetPitchRoll(mobj); if (mobj->flags & MF_NOCLIPTHING) { if (P_CheckDeathPitCollide(mobj)) diff --git a/src/p_user.c b/src/p_user.c index 0fb242fbf..d3fd068ba 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -488,8 +488,7 @@ void P_ResetPlayer(player_t *player) if (player->mo != NULL && P_MobjWasRemoved(player->mo) == false) { - player->mo->pitch = 0; - player->mo->roll = 0; + P_ResetPitchRoll(player->mo); } }