From 6142963ff9a8f650aa20cc681eb3f24ac6f717ba Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Fri, 26 Feb 2021 03:30:52 -0500 Subject: [PATCH] Add minimum distance to prediction --- src/k_bot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/k_bot.c b/src/k_bot.c index 3e2ed52ab..b4dfb7a45 100644 --- a/src/k_bot.c +++ b/src/k_bot.c @@ -572,7 +572,9 @@ static botprediction_t *K_CreateBotPrediction(player_t *player) const tic_t futuresight = (TICRATE * normal) / max(1, handling); // How far ahead into the future to try and predict const fixed_t speed = max(P_AproxDistance(player->mo->momx, player->mo->momy), K_GetKartSpeed(player, false) / 4); - const INT32 distance = (FixedMul(speed, distreduce) / FRACUNIT) * futuresight; + + const INT32 startDist = (DEFAULT_WAYPOINT_RADIUS * mapobjectscale) / FRACUNIT; + const INT32 distance = ((FixedMul(speed, distreduce) / FRACUNIT) * futuresight) + startDist; botprediction_t *predict = Z_Calloc(sizeof(botprediction_t), PU_LEVEL, NULL); waypoint_t *wp = player->nextwaypoint;