Add minimum distance to prediction

This commit is contained in:
Sally Coolatta 2021-02-26 03:30:52 -05:00
parent 7eac54a749
commit 6142963ff9

View file

@ -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;