mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Bots treat all offroad as wall
Rather than only strong offroad.
This commit is contained in:
parent
63ae0ea6bd
commit
bd337d1494
2 changed files with 14 additions and 3 deletions
|
|
@ -149,7 +149,7 @@ static boolean K_BotHatesThisSectorsSpecial(player_t *player, sector_t *sec)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (sec->offroad > FRACUNIT) // Only care about strong offroad.
|
||||
if (sec->offroad > 0)
|
||||
{
|
||||
return !K_BotCanTakeCut(player);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -334,6 +334,12 @@ static boolean P_CanTraceBlockingLine(seg_t *seg, divline_t *divl, register los_
|
|||
|
||||
(void)divl;
|
||||
|
||||
if (!(line->flags & ML_TWOSIDED))
|
||||
{
|
||||
// stop because it is not two sided anyway
|
||||
return false;
|
||||
}
|
||||
|
||||
if (P_IsLineBlocking(line, los->compareThing) == true)
|
||||
{
|
||||
// This line will always block us
|
||||
|
|
@ -380,11 +386,16 @@ static boolean P_CanBotTraverse(seg_t *seg, divline_t *divl, register los_t *los
|
|||
if (los->compareThing->player != NULL && los->alreadyHates == false)
|
||||
{
|
||||
// Treat damage sectors like walls, if you're not already in a bad sector.
|
||||
const sector_t *front, *back;
|
||||
vertex_t pos;
|
||||
|
||||
P_ClosestPointOnLine(los->compareThing->x, los->compareThing->y, line, &pos);
|
||||
|
||||
if (K_BotHatesThisSector(los->compareThing->player, line->frontsector, pos.x, pos.y)
|
||||
|| K_BotHatesThisSector(los->compareThing->player, line->backsector, pos.x, pos.y))
|
||||
front = seg->frontsector;
|
||||
back = seg->backsector;
|
||||
|
||||
if (K_BotHatesThisSector(los->compareThing->player, front, pos.x, pos.y)
|
||||
|| K_BotHatesThisSector(los->compareThing->player, back, pos.x, pos.y))
|
||||
{
|
||||
// This line does not block us, but we don't want to be in it.
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue