From: Mario Date: Sat, 20 Aug 2016 16:31:38 +0000 (+1000) Subject: Produce a stern warning instead of crashing if only 1 team is available (single team... X-Git-Tag: xonotic-v0.8.2~693 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=13efcc536f86e7618cacd5a49b9e79e86585a379;p=xonotic%2Fxonotic-data.pk3dir.git Produce a stern warning instead of crashing if only 1 team is available (single team mode support) --- diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 56f85bd46..61a9d2fad 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