mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-19 12:01:36 +00:00
Add back rubberband friction and speed friction
This commit is contained in:
parent
926a95f117
commit
0cb1f7bc41
1 changed files with 6 additions and 6 deletions
12
src/k_kart.c
12
src/k_kart.c
|
|
@ -13017,13 +13017,14 @@ fixed_t K_PlayerBaseFriction(const player_t *player, fixed_t original)
|
|||
}
|
||||
else if (K_PlayerUsesBotMovement(player) == true)
|
||||
{
|
||||
// const fixed_t speedPercent = min(FRACUNIT, FixedDiv(player->speed, K_GetKartSpeed(player, false, false)));
|
||||
// const fixed_t extraFriction = FixedMul(FixedMul(FRACUNIT >> 5, factor), speedPercent);
|
||||
const fixed_t speedPercent = min(FRACUNIT, FixedDiv(player->speed, K_GetKartSpeed(player, false, false)));
|
||||
const fixed_t extraFriction = FixedMul(FixedMul(FRACUNIT >> 5, factor), speedPercent);
|
||||
|
||||
// A bit extra friction to help them without drifting.
|
||||
// Remove this line once they can drift.
|
||||
// frict -= extraFriction;
|
||||
frict -= extraFriction;
|
||||
|
||||
// If bots are moving in the wrong direction relative to where they want to look, add some extra grip.
|
||||
angle_t MAXERROR = 45*ANG1;
|
||||
fixed_t errorfrict = Easing_Linear(min(FRACUNIT, FixedDiv(player->botvars.predictionError, MAXERROR)), 0, FRACUNIT>>2);
|
||||
|
||||
|
|
@ -13036,15 +13037,14 @@ fixed_t K_PlayerBaseFriction(const player_t *player, fixed_t original)
|
|||
}
|
||||
|
||||
errorfrict = min(errorfrict, frict/4);
|
||||
|
||||
frict -= errorfrict;
|
||||
|
||||
// Bots gain more traction as they rubberband.
|
||||
const fixed_t traction_value = FixedMul(player->botvars.rubberband, max(FRACUNIT, K_BotMapModifier()));
|
||||
if (traction_value > FRACUNIT)
|
||||
{
|
||||
//const fixed_t traction_mul = traction_value - FRACUNIT;
|
||||
// frict -= FixedMul(extraFriction, traction_mul);
|
||||
const fixed_t traction_mul = traction_value - FRACUNIT;
|
||||
frict -= FixedMul(extraFriction, traction_mul);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue