]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add 4 team CTF support to superspectate
authorMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 12:52:00 +0000 (22:52 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 12:52:00 +0000 (22:52 +1000)
qcsrc/server/mutators/mutator_superspec.qc

index bac05be86c039f96624efeb434f1544db53c3c4d..b75e5d424c8638c4038aad900e500314d952ed13 100644 (file)
@@ -387,15 +387,18 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand)
                        return true;
 
                entity _player;
-               float _team = 0;
-               float found = false;
+               int _team = 0;
+               bool found = false;
 
                if(cmd_argc == 2)
                {
-                       if(argv(1) == "red")
-                               _team = NUM_TEAM_1;
-                       else
-                               _team = NUM_TEAM_2;
+                       switch(argv(1))
+                       {
+                               case "red": _team = NUM_TEAM_1; break;
+                               case "blue": _team = NUM_TEAM_2; break;
+                               case "yellow": if(ctf_teams >= 3) _team = NUM_TEAM_3; break;
+                               case "pink": if(ctf_teams >= 4) _team = NUM_TEAM_4; break;
+                       }
                }
 
                FOR_EACH_PLAYER(_player)