mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'drift-ease-idea' into 'master'
Drift easing idea See merge request KartKrew/Kart!2330
This commit is contained in:
commit
bf3e99d8a9
1 changed files with 14 additions and 4 deletions
18
src/k_kart.c
18
src/k_kart.c
|
|
@ -10530,10 +10530,20 @@ INT16 K_GetKartTurnValue(const player_t *player, INT16 turnvalue)
|
||||||
{
|
{
|
||||||
if (player->pflags & PF_DRIFTEND)
|
if (player->pflags & PF_DRIFTEND)
|
||||||
{
|
{
|
||||||
// Sal: K_GetKartDriftValue is short-circuited to give a weird additive magic number,
|
// Sal: This was an unintended control regression from SRB2Kart, but we
|
||||||
// instead of an entirely replaced turn value. This gaslit me years ago when I was doing a
|
// kind of prefer how it feels. It kind of sucks because the original
|
||||||
// code readability pass, where I missed that fact because it also returned early.
|
// eats turning entirely for a few tics. Let's do a healthy medium between
|
||||||
turnfixed += K_GetKartDriftValue(player, FRACUNIT) * FRACUNIT;
|
// SRB2Kart and RR: the kick-out value is eased towards normal turning control.
|
||||||
|
|
||||||
|
fixed_t drift_end_term = K_GetKartDriftValue(player, FRACUNIT) * FRACUNIT;
|
||||||
|
fixed_t drift_exit_frac = (abs(player->drift) * FRACUNIT) / 5;
|
||||||
|
|
||||||
|
turnfixed = Easing_Linear(
|
||||||
|
drift_exit_frac,
|
||||||
|
turnfixed,
|
||||||
|
drift_end_term
|
||||||
|
);
|
||||||
|
|
||||||
return (turnfixed / FRACUNIT);
|
return (turnfixed / FRACUNIT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue