]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
Some random fixes and stuff (centerprints converted to notifications, less spam when...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index 33d3ebd3603a030a6eb6b934e2708478e544ebef..5f2f278e71b355ba93dce46f44d59e9dfec7c6c7 100644 (file)
@@ -94,6 +94,10 @@ void InitGameplayMode()
                fraglimit_override = autocvar_g_domination_point_limit;
                leadlimit_override = autocvar_g_domination_point_leadlimit;
                MUTATOR_ADD(gamemode_domination);
+
+               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
        }
 
@@ -659,16 +663,8 @@ float FindSmallestTeam(entity pl, float ignore_pl)
        {
                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");
-               else if(g_ctf)
-                       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");
+                       error(sprintf("Too few teams available for %s\n", MapInfo_Type_ToString(MapInfo_CurrentGametype())));
        }
 
        // count how many players are in each team
@@ -823,7 +819,7 @@ void SV_ChangeTeam(float _color)
        }
 
        if((autocvar_g_campaign) || (autocvar_g_changeteam_banned && self.wasplayer)) {
-               sprint(self, "Team changes not allowed\n");
+               Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_TEAMCHANGE_NOTALLOWED);
                return; // changing teams is not allowed
        }
 
@@ -833,7 +829,7 @@ void SV_ChangeTeam(float _color)
                GetTeamCounts(self);
                if(!TeamSmallerEqThanTeam(dteam, steam, self))
                {
-                       sprint(self, "Cannot change to a larger/better/shinier team\n");
+                       Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_TEAMCHANGE_LARGERTEAM);
                        return;
                }
        }
@@ -994,7 +990,7 @@ void ShufflePlayerOutOfTeam (float source_team)
 
        if(selected.deadflag == DEAD_NO)
                Damage(selected, selected, selected, 100000, DEATH_AUTOTEAMCHANGE, selected.origin, '0 0 0');
-       centerprint(selected, strcat("You have been moved into a different team to improve team balance\nYou are now on: ", Team_ColoredFullName(selected.team)));
+       Send_Notification(NOTIF_ONE, selected, MSG_CENTER, CENTER_DEATH_SELF_AUTOTEAMCHANGE, selected.team);
 }
 
 // code from here on is just to support maps that don't have team entities