Bots play more careful around damage, insta-kill, and strong offroad

This commit is contained in:
Sally Cochenour 2020-04-28 14:24:09 -04:00
parent 44334602e5
commit c06c4049c4

View file

@ -216,6 +216,24 @@ fixed_t closestlinedist = INT32_MAX;
INT16 badsteerglobal = 0;
static boolean K_BotHatesThisSector(sector_t *sec)
{
switch (GETSECSPECIAL(sec->special, 1))
{
case 1: // Damage
//case 2: case 3: // Offroad (let's let them lawnmower)
case 4: // Offroad (Strong)
case 5: // Spikes
case 6: case 7: // Death Pit
case 8: // Instant Kill
return true;
default:
break;
}
return false;
}
static inline boolean K_FindBlockingWalls(line_t *line)
{
// Condensed version of PIT_CheckLine
@ -282,6 +300,22 @@ static inline boolean K_FindBlockingWalls(line_t *line)
goto blocked;
}
if (!K_BotHatesThisSector(botmo->subsector->sector))
{
// Treat damage sectors like walls
if (lineside)
{
if (K_BotHatesThisSector(line->frontsector))
goto blocked;
}
else
{
if (K_BotHatesThisSector(line->backsector))
goto blocked;
}
}
// We weren't blocked!
return true;