Don't see spectators for specfic bot actions
This commit is contained in:
parent
4eb0901ff7
commit
42a4f9552d
2 changed files with 25 additions and 17 deletions
39
src/k_bot.c
39
src/k_bot.c
|
|
@ -449,11 +449,11 @@ static line_t *K_FindBotController(mobj_t *mo)
|
|||
Return:-
|
||||
Distance to add, as an integer.
|
||||
--------------------------------------------------*/
|
||||
static UINT32 K_BotRubberbandDistance(player_t *player)
|
||||
static UINT32 K_BotRubberbandDistance(const player_t *player)
|
||||
{
|
||||
const UINT32 spacing = FixedDiv(640 * mapobjectscale, K_GetKartGameSpeedScalar(gamespeed)) / FRACUNIT;
|
||||
const UINT8 portpriority = player - players;
|
||||
UINT8 pos = 0;
|
||||
UINT8 pos = 1;
|
||||
UINT8 i;
|
||||
|
||||
if (player->botvars.rival)
|
||||
|
|
@ -469,21 +469,28 @@ static UINT32 K_BotRubberbandDistance(player_t *player)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (playeringame[i] && players[i].bot)
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
{
|
||||
// First check difficulty levels, then score, then settle it with port priority!
|
||||
if (player->botvars.difficulty < players[i].botvars.difficulty)
|
||||
{
|
||||
pos += 3;
|
||||
}
|
||||
else if (player->score < players[i].score)
|
||||
{
|
||||
pos += 2;
|
||||
}
|
||||
else if (i < portpriority)
|
||||
{
|
||||
pos += 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!players[i].bot)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// First check difficulty levels, then score, then settle it with port priority!
|
||||
if (player->botvars.difficulty < players[i].botvars.difficulty)
|
||||
{
|
||||
pos += 3;
|
||||
}
|
||||
else if (player->score < players[i].score)
|
||||
{
|
||||
pos += 2;
|
||||
}
|
||||
else if (i < portpriority)
|
||||
{
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -520,6 +520,7 @@ static BlockItReturn_t K_FindObjectsForNudging(mobj_t *thing)
|
|||
break;
|
||||
case MT_PLAYER:
|
||||
if (thing->player
|
||||
&& !thing->player->spectator
|
||||
&& !thing->player->hyudorotimer
|
||||
&& !globalsmuggle.botmo->player->hyudorotimer)
|
||||
{
|
||||
|
|
@ -857,7 +858,7 @@ static BlockItReturn_t K_FindPlayersToBully(mobj_t *thing)
|
|||
return BMIT_CONTINUE;
|
||||
}
|
||||
|
||||
if (!thing->player)
|
||||
if (!thing->player || thing->player->spectator)
|
||||
{
|
||||
return BMIT_CONTINUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue