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:
Sally Coolatta 2021-12-12 02:07:21 -05:00
parent 5f4e4f8cb5
commit 0e43a04dee
2 changed files with 18 additions and 4 deletions

View file

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

View file

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