Allow players to turn when they're in the air at 0 speed

Minor weird thing I noticed long ago
This commit is contained in:
Sally Coolatta 2021-03-09 17:30:41 -05:00
parent 3ebedeaa08
commit 029c36d59a

View file

@ -7017,36 +7017,36 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue)
fixed_t turnfixed = turnvalue * FRACUNIT; fixed_t turnfixed = turnvalue * FRACUNIT;
fixed_t currentSpeed = 0; fixed_t currentSpeed = 0;
if (player->mo == NULL || P_MobjWasRemoved(player->mo)) if (player->mo == NULL || P_MobjWasRemoved(player->mo) || player->spectator || objectplacing)
{
return 0;
}
if (player->spectator || objectplacing)
{ {
// Invalid object, or incorporeal player. Return the value exactly.
return turnvalue; return turnvalue;
} }
if (leveltime < introtime) if (leveltime < introtime)
{ {
return 0; // No turning during the intro
}
if (player->trickpanel != 0)
{
return 0; return 0;
} }
if (player->respawn.state == RESPAWNST_MOVE) if (player->respawn.state == RESPAWNST_MOVE)
{ {
// No turning during respawn
return 0;
}
if (player->trickpanel != 0)
{
// No turning during trick panel
return 0; return 0;
} }
currentSpeed = R_PointToDist2(0, 0, player->mo->momx, player->mo->momy); currentSpeed = R_PointToDist2(0, 0, player->mo->momx, player->mo->momy);
if ((currentSpeed <= 0) // Not moving if ((currentSpeed <= 0) // Not moving
&& ((K_GetKartButtons(player) & BT_EBRAKEMASK) != BT_EBRAKEMASK) // not e-braking && ((K_GetKartButtons(player) & BT_EBRAKEMASK) != BT_EBRAKEMASK) // Not e-braking
&& (player->respawn.state == RESPAWNST_NONE)) // Not respawning && (player->respawn.state == RESPAWNST_NONE) // Not respawning
&& (P_IsObjectOnGround(player->mo) == false)) // On the ground
{ {
return 0; return 0;
} }