]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix a crash
authorRudolf Polzer <divverent@alientrap.org>
Thu, 30 Dec 2010 20:48:41 +0000 (21:48 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 30 Dec 2010 20:48:41 +0000 (21:48 +0100)
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/scores_rules.qc

index ca2c20e012894184d6046d5533b9a7bde64fbf1d..c57be73ed1529c410cfa3f9380d6643e6738fd5a 100644 (file)
@@ -23,6 +23,7 @@ void freezetag_CheckWinner()
 
        entity e, winner;
        string teamname;
+       winner = world;
 
        FOR_EACH_PLAYER(e)
        {
@@ -35,7 +36,6 @@ void freezetag_CheckWinner()
 
        if(winner != world) // just in case a winner wasn't found
        {
-               TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
                if(winner.team == COLOR_TEAM1)
                        teamname = "^1Red Team";
                else if(winner.team == COLOR_TEAM2)
@@ -48,6 +48,7 @@ void freezetag_CheckWinner()
                        centerprint(e, strcat(teamname, "^5 wins the round, all other teams were frozen.\n"));
                }
                bprint(teamname, "^5 wins the round since all the other teams were frozen.\n");
+               TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
        }
 
        next_round = time + 5;
index 92ea0366b8a67c634c2e1bf880bd77032c433450..61fc9f4c9e5e5521778427724f033bc756ff1338 100644 (file)
@@ -34,7 +34,6 @@ void ScoreRules_basics_end()
 }
 void ScoreRules_generic()
 {
-       CheckAllowedTeams(world);
        if(teams_matter)
        {
                CheckAllowedTeams(world);
@@ -207,7 +206,8 @@ void ScoreRules_keepaway()
 #define SP_FREEZETAG_REVIVALS 4
 void ScoreRules_freezetag()
 {
-       ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
+       CheckAllowedTeams(world);
+       ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
        ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS,           "revivals",             0);
        ScoreRules_basics_end();
 }