From: terencehill <piuntn@gmail.com>
Date: Tue, 25 Feb 2014 16:09:53 +0000 (+0100)
Subject: Hide missing_team notification if there's nobody playing, it's pointless
X-Git-Tag: xonotic-v0.8.0~126^2~12
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=00ef2624a0bec18aaa1530178f9646f9ad06d2e9;p=xonotic%2Fxonotic-data.pk3dir.git

Hide missing_team notification if there's nobody playing, it's pointless
---

diff --git a/qcsrc/server/mutators/gamemode_ca.qc b/qcsrc/server/mutators/gamemode_ca.qc
index 093c17c2ab..cf5dde111a 100644
--- a/qcsrc/server/mutators/gamemode_ca.qc
+++ b/qcsrc/server/mutators/gamemode_ca.qc
@@ -118,6 +118,13 @@ float CA_CheckTeams()
 		prev_missing_teams_mask = -1;
 		return 1;
 	}
+	if(total_players == 0)
+	{
+		if(prev_missing_teams_mask > 0)
+			Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_TEAMS);
+		prev_missing_teams_mask = -1;
+		return 0;
+	}
 	float missing_teams_mask = (!redalive) + (!bluealive) * 2;
 	if(ca_teams >= 3) missing_teams_mask += (!yellowalive) * 4;
 	if(ca_teams >= 4) missing_teams_mask += (!pinkalive) * 8;
diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc
index 16dad4cbac..d6b5372881 100644
--- a/qcsrc/server/mutators/gamemode_freezetag.qc
+++ b/qcsrc/server/mutators/gamemode_freezetag.qc
@@ -52,6 +52,13 @@ float freezetag_CheckTeams()
 		prev_missing_teams_mask = -1;
 		return 1;
 	}
+	if(total_players == 0)
+	{
+		if(prev_missing_teams_mask > 0)
+			Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_TEAMS);
+		prev_missing_teams_mask = -1;
+		return 0;
+	}
 	float missing_teams_mask = (!redalive) + (!bluealive) * 2;
 	if(freezetag_teams >= 3) missing_teams_mask += (!yellowalive) * 4;
 	if(freezetag_teams >= 4) missing_teams_mask += (!pinkalive) * 8;