mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-31 04:02:37 +00:00
Give bots friction rubberband again
This commit is contained in:
parent
cd2dd1315a
commit
d7256aa5f6
2 changed files with 18 additions and 4 deletions
20
src/k_kart.c
20
src/k_kart.c
|
|
@ -3467,7 +3467,7 @@ fixed_t K_GetNewSpeed(player_t *player)
|
|||
// Don't calculate the acceleration as ever being above top speed
|
||||
if (oldspeed > p_speed)
|
||||
oldspeed = p_speed;
|
||||
newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), K_PlayerBaseFriction(ORIG_FRICTION));
|
||||
newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), K_PlayerBaseFriction(player, ORIG_FRICTION));
|
||||
|
||||
finalspeed = newspeed - oldspeed;
|
||||
|
||||
|
|
@ -10189,7 +10189,7 @@ static void K_AirFailsafe(player_t *player)
|
|||
//
|
||||
// K_PlayerBaseFriction
|
||||
//
|
||||
fixed_t K_PlayerBaseFriction(fixed_t original)
|
||||
fixed_t K_PlayerBaseFriction(player_t *player, fixed_t original)
|
||||
{
|
||||
fixed_t frict = original;
|
||||
|
||||
|
|
@ -10197,6 +10197,20 @@ fixed_t K_PlayerBaseFriction(fixed_t original)
|
|||
{
|
||||
frict -= FRACUNIT >> 4;
|
||||
}
|
||||
else if (K_PlayerUsesBotMovement(player) == true)
|
||||
{
|
||||
// A bit extra friction to help them without drifting.
|
||||
// Remove this line once they can drift.
|
||||
frict -= FRACUNIT >> 5;
|
||||
|
||||
// Bots gain more traction as they rubberband.
|
||||
if (player->botvars.rubberband > FRACUNIT)
|
||||
{
|
||||
static const fixed_t extraFriction = FRACUNIT >> 5;
|
||||
const fixed_t mul = player->botvars.rubberband - FRACUNIT;
|
||||
frict -= FixedMul(extraFriction, mul);
|
||||
}
|
||||
}
|
||||
|
||||
if (frict > FRACUNIT) { frict = FRACUNIT; }
|
||||
if (frict < 0) { frict = 0; }
|
||||
|
|
@ -10209,7 +10223,7 @@ fixed_t K_PlayerBaseFriction(fixed_t original)
|
|||
//
|
||||
void K_AdjustPlayerFriction(player_t *player)
|
||||
{
|
||||
const fixed_t prevfriction = K_PlayerBaseFriction(player->mo->friction);
|
||||
const fixed_t prevfriction = K_PlayerBaseFriction(player, player->mo->friction);
|
||||
|
||||
if (P_IsObjectOnGround(player->mo) == false)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ fixed_t K_3dKartMovement(player_t *player);
|
|||
boolean K_PlayerEBrake(player_t *player);
|
||||
SINT8 K_Sliptiding(player_t *player);
|
||||
boolean K_FastFallBounce(player_t *player);
|
||||
fixed_t K_PlayerBaseFriction(fixed_t original);
|
||||
fixed_t K_PlayerBaseFriction(player_t *player, fixed_t original);
|
||||
void K_AdjustPlayerFriction(player_t *player);
|
||||
void K_MoveKartPlayer(player_t *player, boolean onground);
|
||||
void K_CheckSpectateStatus(void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue