mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
Bots play more careful around damage, insta-kill, and strong offroad
This commit is contained in:
parent
44334602e5
commit
c06c4049c4
1 changed files with 34 additions and 0 deletions
34
src/k_bot.c
34
src/k_bot.c
|
|
@ -216,6 +216,24 @@ fixed_t closestlinedist = INT32_MAX;
|
||||||
|
|
||||||
INT16 badsteerglobal = 0;
|
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)
|
static inline boolean K_FindBlockingWalls(line_t *line)
|
||||||
{
|
{
|
||||||
// Condensed version of PIT_CheckLine
|
// Condensed version of PIT_CheckLine
|
||||||
|
|
@ -282,6 +300,22 @@ static inline boolean K_FindBlockingWalls(line_t *line)
|
||||||
goto blocked;
|
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!
|
// We weren't blocked!
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue