]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a crash in CTF
authorMario <mario@smbclan.net>
Thu, 16 Jun 2016 05:40:12 +0000 (15:40 +1000)
committerMario <mario@smbclan.net>
Thu, 16 Jun 2016 05:40:12 +0000 (15:40 +1000)
qcsrc/server/mutators/mutator/gamemode_ctf.qc

index 70a2c040bf80ca91c4889ae8a6b27eac6b907d85..f9872e7490ed45b665b718490ee42f63dbaa7a07 100644 (file)
@@ -2561,9 +2561,9 @@ void ctf_SpawnTeam (string teamname, int teamcolor)
 {
        entity this = new_pure(ctf_team);
        this.netname = teamname;
-       this.cnt = teamcolor;
+       this.cnt = teamcolor - 1;
        this.spawnfunc_checked = true;
-       spawnfunc_ctf_team(this);
+       this.team = teamcolor;
 }
 
 void ctf_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
@@ -2584,12 +2584,12 @@ void ctf_DelayedInit(entity this) // Do this check with a delay so we can wait f
        if(find(NULL, classname, "ctf_team") == NULL)
        {
                LOG_TRACE("No \"ctf_team\" entities found on this map, creating them anyway.\n");
-               ctf_SpawnTeam("Red", NUM_TEAM_1 - 1);
-               ctf_SpawnTeam("Blue", NUM_TEAM_2 - 1);
+               ctf_SpawnTeam("Red", NUM_TEAM_1);
+               ctf_SpawnTeam("Blue", NUM_TEAM_2);
                if(ctf_teams >= 3)
-                       ctf_SpawnTeam("Yellow", NUM_TEAM_3 - 1);
+                       ctf_SpawnTeam("Yellow", NUM_TEAM_3);
                if(ctf_teams >= 4)
-                       ctf_SpawnTeam("Pink", NUM_TEAM_4 - 1);
+                       ctf_SpawnTeam("Pink", NUM_TEAM_4);
        }
 
        ctf_ScoreRules(ctf_teams);