Xonotic
sv_race.qh File Reference
+ Include dependency graph for sv_race.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void race_Initialize ()
 
void rc_SetLimits ()
 
 REGISTER_MUTATOR (rc, false)
 

Function Documentation

◆ race_Initialize()

void race_Initialize ( )

Definition at line 398 of file sv_race.qc.

References g_race_qualifying, race_ScoreRules(), and warmup_stage.

Referenced by REGISTER_MUTATOR().

399 {
400  race_ScoreRules();
401  if(g_race_qualifying == 2)
402  warmup_stage = 0;
403  radar_showenemies = true;
404 }
bool warmup_stage
Definition: main.qh:103
bool g_race_qualifying
Definition: race.qh:12
void race_ScoreRules()
Definition: sv_race.qc:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rc_SetLimits()

void rc_SetLimits ( )

Definition at line 406 of file sv_race.qc.

References autocvar_g_campaign, autocvar_g_race_laps_limit, autocvar_g_race_qualifying_timelimit, autocvar_g_race_qualifying_timelimit_override, autocvar_g_race_teams, BITS, bound(), g_race_qualifying, GameRules_limit_lead(), GameRules_limit_score(), GameRules_limit_time(), GameRules_limit_time_qualifying(), GameRules_teams(), independent_players, race_fraglimit, race_leadlimit, RACE_RECORD, race_teams, race_timelimit, and record_type.

Referenced by REGISTER_MUTATOR().

407 {
408  int fraglimit_override, leadlimit_override;
409  float timelimit_override, qualifying_override;
410 
412  {
413  GameRules_teams(true);
415  }
416  else
417  race_teams = 0;
418 
419  qualifying_override = autocvar_g_race_qualifying_timelimit_override;
420  fraglimit_override = autocvar_g_race_laps_limit;
421  leadlimit_override = 0; // currently not supported by race
422  timelimit_override = autocvar_timelimit_override;
423 
424  float want_qualifying = ((qualifying_override >= 0) ? qualifying_override : autocvar_g_race_qualifying_timelimit) > 0;
425 
427 
429  {
430  g_race_qualifying = 1;
432  }
433  else if(want_qualifying)
434  {
435  g_race_qualifying = 2;
437  race_fraglimit = (fraglimit_override >= 0) ? fraglimit_override : autocvar_fraglimit;
438  race_leadlimit = (leadlimit_override >= 0) ? leadlimit_override : autocvar_leadlimit;
439  race_timelimit = (timelimit_override >= 0) ? timelimit_override : autocvar_timelimit;
440  qualifying_override = (qualifying_override >= 0) ? qualifying_override : autocvar_g_race_qualifying_timelimit;
441  fraglimit_override = 0;
442  leadlimit_override = 0;
443  timelimit_override = qualifying_override;
444  }
445  else
446  g_race_qualifying = 0;
447  GameRules_limit_score(fraglimit_override);
448  GameRules_limit_lead(leadlimit_override);
449  GameRules_limit_time(timelimit_override);
450  GameRules_limit_time_qualifying(qualifying_override);
451 }
float autocvar_g_race_qualifying_timelimit_override
Definition: sv_race.qc:13
#define autocvar_g_race_laps_limit
Definition: sv_race.qc:11
void GameRules_limit_score(int limit)
Definition: sv_rules.qc:34
#define RACE_RECORD
Definition: util.qh:58
bool g_race_qualifying
Definition: race.qh:12
void GameRules_limit_time_qualifying(int limit)
Definition: sv_rules.qc:64
void GameRules_limit_time(int limit)
Definition: sv_rules.qc:54
void GameRules_teams(bool value)
Definition: sv_rules.qc:6
string record_type
Definition: world.qh:49
int autocvar_g_race_teams
Definition: sv_race.qc:14
bool independent_players
Definition: client.qh:312
float race_fraglimit
Definition: race.qh:20
float autocvar_g_race_qualifying_timelimit
Definition: sv_race.qc:12
void GameRules_limit_lead(int limit)
Definition: sv_rules.qc:44
bool autocvar_g_campaign
Definition: campaign.qh:6
float race_leadlimit
Definition: race.qh:21
#define BITS(n)
Definition: bits.qh:9
float race_timelimit
Definition: race.qh:22
float race_teams
Definition: race.qh:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( rc  ,
false   
)

Definition at line 7 of file sv_race.qh.

References MUTATOR_ONADD, MUTATOR_STATIC, race_Initialize(), and rc_SetLimits().

8 {
11  {
12  rc_SetLimits();
13 
15  }
16  return 0;
17 }
void race_Initialize()
Definition: sv_race.qc:398
#define MUTATOR_STATIC()
Definition: base.qh:288
void rc_SetLimits()
Definition: sv_race.qc:406
#define MUTATOR_ONADD
Definition: base.qh:284
+ Here is the call graph for this function: