Add toggle to force rivals
This commit is contained in:
parent
5d8579dd56
commit
e1083d9d74
3 changed files with 19 additions and 0 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue