mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Give bots friction rubberband again
This commit is contained in:
parent
63d156b942
commit
9561ec69bf
2 changed files with 18 additions and 4 deletions
20
src/k_kart.c
20
src/k_kart.c
|
|
@ -3453,7 +3453,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;
|
||||
|
||||
|
|
@ -10014,7 +10014,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;
|
||||
|
||||
|
|
@ -10022,6 +10022,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; }
|
||||
|
|
@ -10034,7 +10048,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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -177,7 +177,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