- if(g_dm)
- {
- MUTATOR_ADD(gamemode_deathmatch);
- }
-
- if(g_tdm)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_tdm_point_limit;
- leadlimit_override = autocvar_g_tdm_point_leadlimit;
- if(autocvar_g_tdm_team_spawns)
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_tdm);
- }
-
- if(g_domination)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_domination_point_limit;
- leadlimit_override = autocvar_g_domination_point_leadlimit;
- if(autocvar_g_domination_roundbased && autocvar_g_domination_roundbased_point_limit)
- fraglimit_override = autocvar_g_domination_roundbased_point_limit;
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_domination);
- }
-
- if(g_ctf)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_capturelimit_override;
- leadlimit_override = autocvar_captureleadlimit_override;
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_ctf);
- }
-
- if(g_lms)
- {
- fraglimit_override = autocvar_g_lms_lives_override;
- leadlimit_override = 0; // not supported by LMS
- if(fraglimit_override == 0)
- fraglimit_override = -1;
- MUTATOR_ADD(gamemode_lms);
- }
-
- if(g_ca)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_ca_point_limit;
- leadlimit_override = autocvar_g_ca_point_leadlimit;
- if(autocvar_g_ca_team_spawns)
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_ca);
- }
-
- if(g_keyhunt)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_keyhunt_point_limit;
- leadlimit_override = autocvar_g_keyhunt_point_leadlimit;
- if(autocvar_g_keyhunt_team_spawns)
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_keyhunt);
- }
-
- if(g_freezetag)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_freezetag_point_limit;
- leadlimit_override = autocvar_g_freezetag_point_leadlimit;
- if(autocvar_g_freezetag_team_spawns)
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_freezetag);
- }
-
- if(g_assault)
- {
- ActivateTeamplay();
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_assault);
- }
-
- if(g_onslaught)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_onslaught_point_limit;
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_onslaught);
- }
-
- if(g_race)
- {
- if(autocvar_g_race_teams)
- {
- ActivateTeamplay();
- race_teams = bound(2, autocvar_g_race_teams, 4);
- have_team_spawns = -1; // request team spawns
- }
- else
- race_teams = 0;
- qualifying_override = autocvar_g_race_qualifying_timelimit_override;
- fraglimit_override = autocvar_g_race_laps_limit;
- leadlimit_override = 0; // currently not supported by race
-
- // we need to find out the correct value for g_race_qualifying
- float want_qualifying = ((qualifying_override >= 0) ? qualifying_override : autocvar_g_race_qualifying_timelimit) > 0;
-
- if(autocvar_g_campaign)
- {
- g_race_qualifying = 1;
- independent_players = 1;
- }
- else if(!autocvar_g_campaign && want_qualifying)
- {
- g_race_qualifying = 2;
- independent_players = 1;
- race_fraglimit = (race_fraglimit >= 0) ? fraglimit_override : autocvar_fraglimit;
- race_leadlimit = (race_leadlimit >= 0) ? leadlimit_override : autocvar_leadlimit;
- race_timelimit = (race_timelimit >= 0) ? timelimit_override : autocvar_timelimit;
- fraglimit_override = 0;
- leadlimit_override = 0;
- timelimit_override = autocvar_g_race_qualifying_timelimit;
- }
- else
- {
- g_race_qualifying = 0;
- }
-
- MUTATOR_ADD(gamemode_race);
- }
-
- if(g_cts)
- {
- g_race_qualifying = 1;
- fraglimit_override = 0;
- leadlimit_override = 0;
- independent_players = 1;
- MUTATOR_ADD(gamemode_cts);
- }
-
- if(g_nexball)
- {
- fraglimit_override = autocvar_g_nexball_goallimit;
- leadlimit_override = autocvar_g_nexball_goalleadlimit;
- ActivateTeamplay();
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_nexball);
- }
-
- if(g_keepaway)
- {
- MUTATOR_ADD(gamemode_keepaway);
- }
-
- if(g_invasion)
- {
- fraglimit_override = autocvar_g_invasion_point_limit;
- if(autocvar_g_invasion_teams >= 2)
- {
- ActivateTeamplay();
- if(autocvar_g_invasion_team_spawns)
- have_team_spawns = -1; // request team spawns
- }
- MUTATOR_ADD(gamemode_invasion);
- }
-