From 331be71735400bd2199f359178f2e45ca39b0ac3 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 7 Jan 2024 22:35:00 -0800 Subject: [PATCH] Add forcebots cheat, spawn bots in non-GTR_BOTS gametypes --- src/cvars.cpp | 1 + src/k_bot.cpp | 4 +++- src/k_grandprix.c | 9 ++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/cvars.cpp b/src/cvars.cpp index 65b1f1291..98db68528 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -802,6 +802,7 @@ consvar_t cv_capsuletest = OnlineCheat("capsuletest", "Off").values(capsuletest_ consvar_t cv_debugcheese = OnlineCheat("debugcheese", "Off").on_off().description("Disable checks that prevent farming item boxes"); consvar_t cv_debugencorevote = OnlineCheat("debugencorevote", "Off").on_off().description("Force encore choice to appear on vote screen"); +consvar_t cv_forcebots = OnlineCheat("forcebots", "No").yes_no().description("Force bots to appear, even in wrong game modes"); void ForceSkin_OnChange(void); consvar_t cv_forceskin = OnlineCheat("forcecharacter", "None").onchange(ForceSkin_OnChange).description("Force all players to use one character"); diff --git a/src/k_bot.cpp b/src/k_bot.cpp index 6f7af8b32..77f0ca24b 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -44,6 +44,8 @@ #include "discord.h" // DRPC_UpdatePresence #include "i_net.h" // doomcom +extern "C" consvar_t cv_forcebots; + /*-------------------------------------------------- void K_SetBot(UINT8 playerNum, UINT8 skinnum, UINT8 difficulty, botStyle_e style) @@ -189,7 +191,7 @@ void K_UpdateMatchRaceBots(void) } grabskins[usableskins] = MAXSKINS; - if ((gametyperules & GTR_BOTS) == 0) + if ((gametyperules & GTR_BOTS) == 0 && !cv_forcebots.value) { difficulty = 0; } diff --git a/src/k_grandprix.c b/src/k_grandprix.c index ed4bac5f9..7ede8533c 100644 --- a/src/k_grandprix.c +++ b/src/k_grandprix.c @@ -388,7 +388,7 @@ void K_UpdateGrandPrixBots(void) continue; } - players[i].spectator = !(gametyperules & GTR_BOTS) || (grandprixinfo.eventmode != GPEVENT_NONE); + players[i].spectator = K_BotDefaultSpectator(); } if (grandprixinfo.wonround == false) @@ -901,6 +901,13 @@ boolean K_CanChangeRules(boolean allowdemos) --------------------------------------------------*/ boolean K_BotDefaultSpectator(void) { + extern consvar_t cv_forcebots; + + if (cv_forcebots.value) + { + return false; + } + if (!(gametyperules & GTR_BOTS)) { // This gametype does not support bots.