Add toggle to force rivals

This commit is contained in:
NepDisk 2025-10-15 12:44:58 -04:00
parent 5d8579dd56
commit e1083d9d74
3 changed files with 19 additions and 0 deletions

View file

@ -46,6 +46,7 @@
consvar_t cv_forcebots = CVAR_INIT ("kartforcebots", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
consvar_t cv_botcontrol = CVAR_INIT ("kartbotcontrol", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
consvar_t cv_forcerival = CVAR_INIT ("kartbot_forcerival", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
botdata_t botdata[MAXPLAYERS];
@ -159,6 +160,12 @@ void K_SetBot(UINT8 newplayernum, UINT16 skinnum, UINT8 difficulty, botStyle_e s
players[newplayernum].botvars.style = style;
players[newplayernum].lives = 9;
// Does the server want to force rivals? enforce this here.
if (cv_forcerival.value)
{
players[newplayernum].botvars.rival = true;
}
// The bot may immediately become a spectator AT THE START of a GP.
// For each subsequent round of GP, K_UpdateGrandPrixBots will handle this.
players[newplayernum].spectator = grandprixinfo.gp && grandprixinfo.initalize;
@ -279,6 +286,16 @@ void K_UpdateMatchRaceBots(void)
// Enforce normal style for Match Race
players[i].botvars.style = BOT_STYLE_NORMAL;
// Does the server want to force rivals? enforce this here.
if (cv_forcerival.value)
{
players[i].botvars.rival = true;
}
else
{
players[i].botvars.rival = false;
}
}
else
{

View file

@ -24,6 +24,7 @@ extern "C" {
extern consvar_t cv_forcebots;
extern consvar_t cv_botcontrol;
extern consvar_t cv_forcerival;
// Maximum value of botvars.difficulty
#define MAXBOTDIFFICULTY (13)

View file

@ -271,6 +271,7 @@ void K_RegisterKartStuff(void)
CV_RegisterVar(&cv_kartbot_basetrackcomplexity);
CV_RegisterVar(&cv_forcebots);
CV_RegisterVar(&cv_botcontrol);
CV_RegisterVar(&cv_forcerival);
CV_RegisterVar(&cv_karteliminatelast);
CV_RegisterVar(&cv_kartusepwrlv);
CV_RegisterVar(&cv_votetime);