mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Use input steering (not camera steering) on skipped tics
This commit is contained in:
parent
acfd7ffc55
commit
edfd43ce81
1 changed files with 14 additions and 6 deletions
20
src/p_user.c
20
src/p_user.c
|
|
@ -2380,7 +2380,20 @@ static void P_UpdatePlayerAngle(player_t *player)
|
|||
INT16 targetsteering = K_UpdateSteeringValue(player->steering, player->cmd.turning);
|
||||
angleChange = K_GetKartTurnValue(player, targetsteering) << TICCMD_REDUCE;
|
||||
|
||||
if (!K_PlayerUsesBotMovement(player))
|
||||
if (K_PlayerUsesBotMovement(player))
|
||||
{
|
||||
// You're a bot. Go where you're supposed to go
|
||||
player->steering = targetsteering;
|
||||
}
|
||||
else if (!(player->cmd.flags & TICCMD_RECEIVED))
|
||||
{
|
||||
// This player missed a tic! This ticcmd is copied from our last received one,
|
||||
// which means it will include the same angle. If we steer them towards this,
|
||||
// it's very likely we will input the wrong direction and screw with easing state.
|
||||
// Instead, assume the player keeps steering in the direction they were steering.
|
||||
player->steering = targetsteering;
|
||||
}
|
||||
else
|
||||
{
|
||||
// With a full slam on the analog stick, how far could we steer in either direction?
|
||||
INT16 steeringRight = K_UpdateSteeringValue(player->steering, KART_FULLTURN);
|
||||
|
|
@ -2431,11 +2444,6 @@ static void P_UpdatePlayerAngle(player_t *player)
|
|||
angleChange = targetDelta;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// You're a bot. Go where you're supposed to go
|
||||
player->steering = targetsteering;
|
||||
}
|
||||
|
||||
if (p == UINT8_MAX)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue