mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Try adding tripwire support
Kind of lazy. When checking bot traversal, it considers tripwires as walls. K_BotCanTakeCut now is limited to whatever can take tripwires (no more hyudoro invisibility). Probably should have something more foolproof, but it's annoying to test any changes to this. The only maps I can think of with really easy tripwires clearly don't have their waypoints with bots in mind, the rest are very optional or out of the way or otherwise the bots don't want to even touch them at all.
This commit is contained in:
parent
5f4e4f8cb5
commit
0e43a04dee
2 changed files with 18 additions and 4 deletions
16
src/k_bot.c
16
src/k_bot.c
|
|
@ -273,14 +273,22 @@ boolean K_PlayerUsesBotMovement(player_t *player)
|
|||
--------------------------------------------------*/
|
||||
boolean K_BotCanTakeCut(player_t *player)
|
||||
{
|
||||
if (!K_ApplyOffroad(player)
|
||||
if (
|
||||
#if 1
|
||||
K_TripwirePass(player) == true
|
||||
#else
|
||||
K_ApplyOffroad(player) == false
|
||||
#endif
|
||||
|| player->itemtype == KITEM_SNEAKER
|
||||
|| player->itemtype == KITEM_ROCKETSNEAKER
|
||||
|| player->itemtype == KITEM_INVINCIBILITY
|
||||
|| player->itemtype == KITEM_HYUDORO)
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
|
|
@ -721,12 +729,12 @@ static botprediction_t *K_CreateBotPrediction(player_t *player)
|
|||
|
||||
for (i = 0; i < wp->numnextwaypoints; i++)
|
||||
{
|
||||
if (!K_GetWaypointIsEnabled(wp->nextwaypoints[i]))
|
||||
if (K_GetWaypointIsEnabled(wp->nextwaypoints[i]) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (K_GetWaypointIsShortcut(wp->nextwaypoints[i]) && !K_BotCanTakeCut(player))
|
||||
if (K_GetWaypointIsShortcut(wp->nextwaypoints[i]) == true && K_BotCanTakeCut(player) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -758,6 +758,12 @@ static boolean P_CrossBotTraversalSubsector(size_t num, register traceblocking_t
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (P_IsLineTripWire(line) == true && K_TripwirePass(tb->compareThing->player) == false)
|
||||
{
|
||||
// Can't go through trip wire.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue