mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Consider FOFs when figuring out sectors to be careful near
This commit is contained in:
parent
e6e2cd5d82
commit
cb34ea1388
1 changed files with 49 additions and 1 deletions
50
src/k_bot.c
50
src/k_bot.c
|
|
@ -209,7 +209,7 @@ static fixed_t K_DistanceOfLineFromPoint(fixed_t v1x, fixed_t v1y, fixed_t v2x,
|
|||
return P_AproxDistance(cx - px, cy - py);
|
||||
}
|
||||
|
||||
static boolean K_BotHatesThisSector(player_t *player, sector_t *sec)
|
||||
static boolean K_BotHatesThisSectorsSpecial(player_t *player, sector_t *sec)
|
||||
{
|
||||
switch (GETSECSPECIAL(sec->special, 1))
|
||||
{
|
||||
|
|
@ -229,6 +229,54 @@ static boolean K_BotHatesThisSector(player_t *player, sector_t *sec)
|
|||
return false;
|
||||
}
|
||||
|
||||
static boolean K_BotHatesThisSector(player_t *player, sector_t *sec)
|
||||
{
|
||||
const boolean flip = (player->mo->eflags & MFE_VERTICALFLIP);
|
||||
INT32 flag;
|
||||
ffloor_t *rover;
|
||||
|
||||
if (flip)
|
||||
{
|
||||
flag = SF_FLIPSPECIAL_CEILING;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = SF_FLIPSPECIAL_FLOOR;
|
||||
}
|
||||
|
||||
if (sec->flags & flag)
|
||||
{
|
||||
if (K_BotHatesThisSectorsSpecial(player, sec))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (rover = sec->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(rover->master->frontsector->flags & flag))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (((*rover->bottomheight >= player->mo->z + player->mo->height) && (flip))
|
||||
|| ((*rover->topheight <= player->mo->z) && (!flip)))
|
||||
{
|
||||
if (K_BotHatesThisSectorsSpecial(player, sec))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
mobj_t *botmo = NULL;
|
||||
fixed_t distancetocheck = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue