X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fteamplay.qc;h=7df082c8747475d3b6d8fd0e3fb116ecca519fee;hb=84de176ec42eeaeaa7f9b415b0f2b67adb1aa708;hp=912e22c2441e8c9aabea1cef218d45f234b3a2dc;hpb=cc32d8e4288a70b77c61208820e93d3fad56fcdf;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 912e22c24..7df082c87 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -101,6 +101,8 @@ void WriteGameCvars() 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)); + cvar_set("g_keepaway", ftos(g_keepaway)); } void ReadGameCvars() @@ -127,6 +129,8 @@ 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"))); + found += (g_keepaway = (!found && (prev != GAME_KEEPAWAY) && cvar("g_keepaway"))); if(found) break; @@ -210,9 +214,6 @@ void InitGameplayMode() fraglimit_override = cvar("fraglimit_override"); leadlimit_override = cvar("leadlimit_override"); - if(cvar("g_dodging")) - MUTATOR_ADD(dodging); - if(g_dm) { game = GAME_DEATHMATCH; @@ -320,6 +321,16 @@ void InitGameplayMode() 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; @@ -376,6 +387,13 @@ void InitGameplayMode() have_team_spawns = -1; // request team spawns } + if(g_keepaway) + { + game = GAME_KEEPAWAY; + gamemode_name = "Keepaway"; + MUTATOR_ADD(gamemode_keepaway); + } + if(teams_matter) entcs_init(); @@ -515,12 +533,8 @@ void PrintWelcomeMessage(entity pl) modifications = strcat(modifications, ", Cloaked"); 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) @@ -714,6 +728,16 @@ void CheckAllowedTeams (entity for_whom) 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) @@ -800,7 +824,7 @@ float FindSmallestTeam(entity pl, float ignore_pl) if(c4 >= 0) totalteams = totalteams + 1; - if(cvar("bot_vs_human") && totalteams == 1) + if((cvar("bot_vs_human") || pl.team_forced > 0) && totalteams == 1) totalteams += 1; if(totalteams <= 1) @@ -813,6 +837,8 @@ float FindSmallestTeam(entity pl, float ignore_pl) 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"); }