]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
Merge remote-tracking branch 'origin/Mario/arena_nuke'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index 16236dd16ba7d93fb52210553efe8d0ca89a5078..5185b2c611a639093d1f343911182e98d8009cf3 100644 (file)
@@ -54,9 +54,9 @@ void InitGameplayMode()
 
        MapInfo_LoadMapSettings(mapname);
        teamplay = 0;
-       serverflags &~= SERVERFLAG_TEAMPLAY;
+       serverflags &= ~SERVERFLAG_TEAMPLAY;
 
-       if not(cvar_value_issafe(world.fog))
+       if (!cvar_value_issafe(world.fog))
        {
                print("The current map contains a potentially harmful fog setting, ignored\n");
                world.fog = string_null;
@@ -115,13 +115,6 @@ void InitGameplayMode()
                MUTATOR_ADD(gamemode_lms);
        }
 
-       if(g_arena)
-       {
-               fraglimit_override = autocvar_g_arena_point_limit;
-               leadlimit_override = autocvar_g_arena_point_leadlimit;
-               MUTATOR_ADD(gamemode_arena);
-       }
-
        if(g_ca)
        {
                ActivateTeamplay();
@@ -192,7 +185,7 @@ void InitGameplayMode()
         have_team_spawns = -1; // request team spawns
            MUTATOR_ADD(gamemode_nexball);
        }
-        
+
        if(g_keepaway)
        {
                MUTATOR_ADD(gamemode_keepaway);
@@ -270,9 +263,7 @@ string getwelcomemessage(void)
        ret_string = "";
        MUTATOR_CALLHOOK(BuildMutatorsPrettyString);
        modifications = ret_string;
-       
-       if(g_minstagib)
-               modifications = strcat(modifications, ", MinstaGib");
+
        if(g_weaponarena)
        {
                if(g_weaponarena_random)
@@ -288,14 +279,8 @@ string getwelcomemessage(void)
                modifications = strcat(modifications, ", Cloaked");
        if(g_grappling_hook)
                modifications = strcat(modifications, ", Hook");
-       if(g_midair)
-               modifications = strcat(modifications, ", Midair");
-       if(g_pinata)
-               modifications = strcat(modifications, ", PiƱata");
        if(g_weapon_stay && !g_cts)
                modifications = strcat(modifications, ", Weapons stay");
-       if(g_bloodloss > 0)
-               modifications = strcat(modifications, ", Blood loss");
        if(g_jetpack)
                modifications = strcat(modifications, ", Jet pack");
        if(autocvar_g_powerups == 0)
@@ -464,7 +449,7 @@ void CheckAllowedTeams (entity for_whom)
                if(autocvar_bot_vs_human > 0)
                {
                        // bots are all blue
-                       if(clienttype(for_whom) == CLIENTTYPE_BOT)
+                       if(IS_BOT_CLIENT(for_whom))
                                c1 = c3 = c4 = -1;
                        else
                                c2 = -1;
@@ -472,7 +457,7 @@ void CheckAllowedTeams (entity for_whom)
                else
                {
                        // bots are all red
-                       if(clienttype(for_whom) == CLIENTTYPE_BOT)
+                       if(IS_BOT_CLIENT(for_whom))
                                c2 = c3 = c4 = -1;
                        else
                                c1 = -1;
@@ -510,7 +495,7 @@ void GetTeamCounts(entity ignore)
        FOR_EACH_CLIENT(head)
        {
                float t;
-               if(head.classname == "player")
+               if(IS_PLAYER(head))
                        t = head.team;
                else if(head.team_forced > 0)
                        t = head.team_forced; // reserve the spot
@@ -519,7 +504,7 @@ void GetTeamCounts(entity ignore)
                if(head != ignore)// && head.netname != "")
                {
                        value = PlayerValue(head);
-                       if(clienttype(head) == CLIENTTYPE_BOT)
+                       if(IS_BOT_CLIENT(head))
                                bvalue = value;
                        else
                                bvalue = 0;
@@ -600,7 +585,7 @@ float TeamSmallerEqThanTeam(float ta, float tb, entity e)
        if(ta == tb)
                return TRUE;
 
-       if(clienttype(e) == CLIENTTYPE_REAL)
+       if(IS_REAL_CLIENT(e))
        {
                if(bots_would_leave)
                {
@@ -608,7 +593,7 @@ float TeamSmallerEqThanTeam(float ta, float tb, entity e)
                        cb -= cbb * 0.999;
                }
        }
-       
+
        // keep teams alive (teams of size 0 always count as smaller, ignoring score)
        if(ca < 1)
                if(cb >= 1)
@@ -658,7 +643,7 @@ float FindSmallestTeam(entity pl, float ignore_pl)
 
        if(totalteams <= 1)
        {
-               if(autocvar_g_campaign && pl && clienttype(pl) == CLIENTTYPE_REAL)
+               if(autocvar_g_campaign && pl && IS_REAL_CLIENT(pl))
                        return 1; // special case for campaign and player joining
                else if(g_domination)
                        error("Too few teams available for domination\n");
@@ -679,7 +664,7 @@ float FindSmallestTeam(entity pl, float ignore_pl)
                GetTeamCounts(world);
 
        RandomSelection_Init();
-       
+
        t = 1;
        if(TeamSmallerEqThanTeam(2, t, pl))
                t = 2;
@@ -841,7 +826,7 @@ void SV_ChangeTeam(float _color)
 
 //     bprint("allow change teams from ", ftos(steam), " to ", ftos(dteam), "\n");
 
-       if(self.classname == "player" && steam != dteam)
+       if(IS_PLAYER(self) && steam != dteam)
        {
                // reduce frags during a team change
                TeamchangeFrags(self);
@@ -849,7 +834,7 @@ void SV_ChangeTeam(float _color)
 
        SetPlayerTeam(self, dteam, steam, FALSE);
 
-       if(self.classname == "player" && steam != dteam)
+       if(IS_PLAYER(self) && steam != dteam)
        {
                // kill player when changing teams
                if(self.deadflag == DEAD_NO)