mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 10:51:42 +00:00
Fix bot extra friction on ice TERRAIN
This commit is contained in:
parent
d129422382
commit
a2c57d7066
1 changed files with 4 additions and 3 deletions
|
|
@ -10224,22 +10224,23 @@ static void K_AirFailsafe(player_t *player)
|
||||||
//
|
//
|
||||||
fixed_t K_PlayerBaseFriction(player_t *player, fixed_t original)
|
fixed_t K_PlayerBaseFriction(player_t *player, fixed_t original)
|
||||||
{
|
{
|
||||||
|
const fixed_t factor = FixedDiv(FRACUNIT - original, FRACUNIT - ORIG_FRICTION);
|
||||||
fixed_t frict = original;
|
fixed_t frict = original;
|
||||||
|
|
||||||
if (K_PodiumSequence() == true)
|
if (K_PodiumSequence() == true)
|
||||||
{
|
{
|
||||||
frict -= FRACUNIT >> 4;
|
frict -= FixedMul(FRACUNIT >> 4, factor);
|
||||||
}
|
}
|
||||||
else if (K_PlayerUsesBotMovement(player) == true)
|
else if (K_PlayerUsesBotMovement(player) == true)
|
||||||
{
|
{
|
||||||
// A bit extra friction to help them without drifting.
|
// A bit extra friction to help them without drifting.
|
||||||
// Remove this line once they can drift.
|
// Remove this line once they can drift.
|
||||||
frict -= FRACUNIT >> 5;
|
frict -= FixedMul(FRACUNIT >> 5, factor);
|
||||||
|
|
||||||
// Bots gain more traction as they rubberband.
|
// Bots gain more traction as they rubberband.
|
||||||
if (player->botvars.rubberband > FRACUNIT)
|
if (player->botvars.rubberband > FRACUNIT)
|
||||||
{
|
{
|
||||||
static const fixed_t extraFriction = FRACUNIT >> 5;
|
const fixed_t extraFriction = FixedMul(FRACUNIT >> 5, factor);
|
||||||
const fixed_t mul = player->botvars.rubberband - FRACUNIT;
|
const fixed_t mul = player->botvars.rubberband - FRACUNIT;
|
||||||
frict -= FixedMul(extraFriction, mul);
|
frict -= FixedMul(extraFriction, mul);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue