]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Produce a stern warning instead of crashing if only 1 team is available (single team...
authorMario <mario@smbclan.net>
Sat, 20 Aug 2016 16:31:38 +0000 (02:31 +1000)
committerMario <mario@smbclan.net>
Sat, 20 Aug 2016 16:31:38 +0000 (02:31 +1000)
qcsrc/server/teamplay.qc

index 56f85bd4689fd47a7f189dec8d57949435213adf..61a9d2fadd52f4292bff1cf0719378939f726b39 100644 (file)
@@ -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