diff --git a/src/k_bot.cpp b/src/k_bot.cpp index 71a481359..f42f10b4b 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -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 { diff --git a/src/k_bot.h b/src/k_bot.h index 6e9b66ce2..0facb20af 100644 --- a/src/k_bot.h +++ b/src/k_bot.h @@ -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) diff --git a/src/k_kart.c b/src/k_kart.c index 809dba4b4..01bdf6060 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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);