From dcd4f377591abe3346e0ef059f23441d2888244f Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 9 Jan 2024 20:37:32 +0000 Subject: [PATCH 1/2] K_BotRubberbandDistance: Don't sniff spectators --- src/k_bot.cpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/k_bot.cpp b/src/k_bot.cpp index 6f7af8b32..0931a123d 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -540,21 +540,28 @@ static UINT32 K_BotRubberbandDistance(const 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; } } From d94928880a6b4761775dc7962f54b111c00d00c0 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 9 Jan 2024 20:39:55 +0000 Subject: [PATCH 2/2] k_botsearch.cpp: Don't sniff spectators --- src/k_botsearch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/k_botsearch.cpp b/src/k_botsearch.cpp index 1a4e9cc57..b7a479456 100644 --- a/src/k_botsearch.cpp +++ b/src/k_botsearch.cpp @@ -543,6 +543,7 @@ static BlockItReturn_t K_FindObjectsForNudging(mobj_t *thing) break; case MT_PLAYER: if (thing->player + && !thing->player->spectator && !thing->player->hyudorotimer && !g_nudgeSearch.botmo->player->hyudorotimer) { @@ -902,7 +903,7 @@ static BlockItReturn_t K_FindPlayersToBully(mobj_t *thing) return BMIT_CONTINUE; } - if (!thing->player) + if (!thing->player || thing->player->spectator) { return BMIT_CONTINUE; }