return 0;
if(cvar("g_campaign"))
return 0;
+ if(cvar("bot_vs_human") && (c3==-1 && c4==-1))
+ return 0;
if(!cvar("g_balance_teams_force"))
return -1;
return 1;
cvar_set("g_race", ftos(g_race));
cvar_set("g_nexball", ftos(g_nexball));
cvar_set("g_cts", ftos(g_cts));
+ cvar_set("g_freezetag", ftos(g_freezetag));
}
void ReadGameCvars()
found += (g_race = (!found && (prev != GAME_RACE) && cvar("g_race")));
found += (g_nexball = (!found && (prev != GAME_NEXBALL) && cvar("g_nexball")));
found += (g_cts = (!found && (prev != GAME_CTS) && cvar("g_cts")));
+ found += (g_freezetag = (!found && (prev != GAME_FREEZETAG) && cvar("g_freezetag")));
if(found)
break;
fraglimit_override = cvar("fraglimit_override");
leadlimit_override = cvar("leadlimit_override");
- if(cvar("g_dodging"))
- MUTATOR_ADD(dodging);
-
if(g_dm)
{
game = GAME_DEATHMATCH;
MUTATOR_ADD(gamemode_keyhunt);
}
+ if(g_freezetag)
+ {
+ game = GAME_FREEZETAG;
+ gamemode_name = "Freeze Tag";
+ ActivateTeamplay();
+ fraglimit_override = cvar("g_freezetag_point_limit");
+ leadlimit_override = cvar("g_freezetag_point_leadlimit");
+ MUTATOR_ADD(gamemode_freezetag);
+ }
+
if(g_assault)
{
game = GAME_ASSAULT;
modifications = strcat(modifications, ", Low gravity");
if(g_cloaked)
modifications = strcat(modifications, ", Cloaked");
- if(g_footsteps)
- modifications = strcat(modifications, ", Steps");
if(g_grappling_hook)
modifications = strcat(modifications, ", Hook");
- if(g_laserguided_missile)
- modifications = strcat(modifications, ", LG missiles");
if(g_midair)
modifications = strcat(modifications, ", Midair");
- if(g_vampire)
- modifications = strcat(modifications, ", Vampire");
if(g_pinata)
modifications = strcat(modifications, ", Pinata");
if(g_weapon_stay)
}
// TODO: Balance quantity of bots across > 2 teams when bot_vs_human is set (and remove next line)
- if(c3==-1&&c4==-1)
+ if(c3==-1 && c4==-1)
if(cvar("bot_vs_human") && for_whom)
{
if(cvar("bot_vs_human") > 0)
c1 = -1;
}
}
+
+ // if player has a forced team, ONLY allow that one
+ if(self.team_forced == COLOR_TEAM1 && c1 >= 0)
+ c2 = c3 = c4 = -1;
+ else if(self.team_forced == COLOR_TEAM2 && c2 >= 0)
+ c1 = c3 = c4 = -1;
+ else if(self.team_forced == COLOR_TEAM3 && c3 >= 0)
+ c1 = c2 = c4 = -1;
+ else if(self.team_forced == COLOR_TEAM4 && c4 >= 0)
+ c1 = c2 = c3 = -1;
}
float PlayerValue(entity p)
if(IsTeamBalanceForced() == 1)
return 1;
return 1;
+ // FIXME: it always returns 1...
}
// c1...c4 should be set to -1 (not allowed) or 0 (allowed).
if(c4 >= 0)
totalteams = totalteams + 1;
- if(cvar("bot_vs_human"))
+ if((cvar("bot_vs_human") || pl.team_forced > 0) && totalteams == 1)
totalteams += 1;
if(totalteams <= 1)
error("Too few teams available for ctf\n");
else if(g_keyhunt)
error("Too few teams available for key hunt\n");
+ else if(g_freezetag)
+ error("Too few teams available for freeze tag\n");
else
error("Too few teams available for team deathmatch\n");
}