diff --git a/src/k_kart.c b/src/k_kart.c index 97c9c4025..7322e941b 100644 --- a/src/k_kart.c +++ b/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); } } }