]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/teams.qh
Teams: setteam
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / teams.qh
index 5f49faac730771dd4cb26411a16898516d0eb810..d279831b4a5f93610d0354a4ef50dd915590d7d8 100644 (file)
@@ -65,10 +65,11 @@ float myteam;
 #endif
 
 Team TM(int teamid) {
-    if (teamid == 0) return NULL;
+    return = TEAM_SPEC;
+    if (teamid == -1) return;  // catch off-by-one from server NULL.team (0) - 1
+    if (teamid == 0) return;
     FOREACH(Teams, it.Team_id == teamid, return it);
     LOG_SEVEREF("Unknown team: %d", teamid);
-    return NULL;
 }
 
 #define Team_ColorCode(this) (TM(this).m_colorstr)