mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
Players/bots ignore disabled waypoints
This commit is contained in:
parent
1bf8fb595a
commit
9d4afb9aec
3 changed files with 19 additions and 0 deletions
|
|
@ -625,6 +625,10 @@ static botprediction_t *K_CreateBotPrediction(player_t *player)
|
|||
|
||||
for (i = 0; i < wp->numnextwaypoints; i++)
|
||||
{
|
||||
if (!K_GetWaypointIsEnabled(wp->nextwaypoints[i]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (K_GetWaypointIsShortcut(wp->nextwaypoints[i]) && !K_BotCanTakeCut(player))
|
||||
{
|
||||
|
|
|
|||
10
src/k_kart.c
10
src/k_kart.c
|
|
@ -6295,6 +6295,11 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
{
|
||||
for (i = 0U; i < waypoint->numnextwaypoints; i++)
|
||||
{
|
||||
if (!K_GetWaypointIsEnabled(waypoint->nextwaypoints[i]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (K_PlayerUsesBotMovement(player) == true
|
||||
&& K_GetWaypointIsShortcut(waypoint->nextwaypoints[i]) == true
|
||||
&& K_BotCanTakeCut(player) == false)
|
||||
|
|
@ -6350,6 +6355,11 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
{
|
||||
for (i = 0U; i < waypoint->numprevwaypoints; i++)
|
||||
{
|
||||
if (!K_GetWaypointIsEnabled(waypoint->prevwaypoints[i]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
angletowaypoint = R_PointToAngle2(
|
||||
player->mo->x, player->mo->y,
|
||||
waypoint->prevwaypoints[i]->mobj->x, waypoint->prevwaypoints[i]->mobj->y);
|
||||
|
|
|
|||
|
|
@ -280,6 +280,11 @@ waypoint_t *K_GetBestWaypointForMobj(mobj_t *const mobj)
|
|||
|
||||
checkwaypoint = &waypointheap[i];
|
||||
|
||||
if (!K_GetWaypointIsEnabled(checkwaypoint))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
checkdist = P_AproxDistance(
|
||||
(mobj->x / FRACUNIT) - (checkwaypoint->mobj->x / FRACUNIT),
|
||||
(mobj->y / FRACUNIT) - (checkwaypoint->mobj->y / FRACUNIT));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue