From 13efcc536f86e7618cacd5a49b9e79e86585a379 Mon Sep 17 00:00:00 2001
From: Mario <mario@smbclan.net>
Date: Sun, 21 Aug 2016 02:31:38 +1000
Subject: [PATCH] Produce a stern warning instead of crashing if only 1 team is
 available (single team mode support)

---
 qcsrc/server/teamplay.qc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc
index 56f85bd468..61a9d2fadd 100644
--- a/qcsrc/server/teamplay.qc
+++ b/qcsrc/server/teamplay.qc
@@ -473,8 +473,10 @@ 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
-			error(sprintf("Too few teams available for %s\n", MapInfo_Type_ToString(MapInfo_CurrentGametype())));
+		else if(totalteams == 1) // single team
+			LOG_TRACEF("Only 1 team available for %s, you may need to fix your map", MapInfo_Type_ToString(MapInfo_CurrentGametype()));
+		else // no teams, major no no
+			error(sprintf("No teams available for %s\n", MapInfo_Type_ToString(MapInfo_CurrentGametype())));
 	}
 
 	// count how many players are in each team
-- 
2.39.5