]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix the first round now finally, hopefully, other minor fixes
authorFruitieX <fruitiex@gmail.com>
Wed, 17 Nov 2010 20:30:41 +0000 (22:30 +0200)
committerFruitieX <fruitiex@gmail.com>
Wed, 17 Nov 2010 20:30:41 +0000 (22:30 +0200)
qcsrc/server/arena.qc
qcsrc/server/mutators/gamemode_freezetag.qc

index 543a69d744484c061d0fd94939f833b693cf63e7..41540280f3c982f888ded062fbe661560901264a 100644 (file)
@@ -210,7 +210,7 @@ void Arena_Warmup()
        if((!g_arena && !g_ca && !g_freezetag) || (g_arena && !arena_roundbased) || (time < game_starttime))
                return;
 
-       if(g_freezetag &&
+       if(g_freezetag && time > game_starttime &&
                !((redspawned >= 1 && bluespawned >= 1)
                || (redspawned >= 1 && yellowspawned >= 1)
                || (redspawned >= 1 && pinkspawned >= 1)
@@ -349,7 +349,7 @@ void Spawnqueue_Check()
        {
                count_alive_players();
        }
-       if(time < warmup + 1 || inWarmupStage)
+       if(time < warmup + 1 || inWarmupStage || intermission_running)
                return;
 
        if(g_ca) {
index 5c36d491b8805fc4869371fc50228bfa4900b769..fb7525a43b59d7a03c1880560acab38c7cd13e3c 100644 (file)
@@ -1,14 +1,22 @@
 void freezetag_Initialize()
 {
        precache_model("models/ice/ice.md3");
-       warmup = time + cvar("g_freezetag_warmup");
+       next_round = time + cvar("g_start_delay");
 }
 
 void freezetag_CheckWinner()
 {
+       if(time <= game_starttime)
+               return;
+
        if(next_round || (time > warmup - cvar("g_freezetag_warmup") && time < warmup))
                return; // already waiting for next round to start
 
+       if(redalive + bluealive + yellowalive + pinkalive <= 0 && time > game_starttime)
+       {
+               next_round = time + 5;
+       }
+
        if((redalive >= 1 && bluealive >= 1) // counted in arena.qc
                || (redalive >= 1 && yellowalive >= 1)
                || (redalive >= 1 && pinkalive >= 1)
@@ -17,12 +25,6 @@ void freezetag_CheckWinner()
                || (yellowalive >= 1 && pinkalive >= 1))
                return; // we still have active players on two or more teams
 
-       if(redalive + bluealive + yellowalive + pinkalive <= 0)
-       {
-               next_round = time + 5;
-               return;
-       }
-
        entity e, winner;
        string teamname;
 
@@ -31,24 +33,26 @@ void freezetag_CheckWinner()
                if(e.freezetag_frozen == 0 && e.classname == "player" && e.health >= 1) // here's one player from the winning team... good
                {
                        winner = e;
-                       if(winner != world) // just in case a winner isn't found (causes crashes otherwise...)
-                               TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
                        break; // break, we found the winner
                }
        }
 
-       if(winner.team == COLOR_TEAM1)
-               teamname = "^1Red Team";
-       else if(winner.team == COLOR_TEAM2)
-               teamname = "^4Blue Team";
-       else if(winner.team == COLOR_TEAM3)
-               teamname = "^3Yellow Team";
-       else
-               teamname = "^6Pink Team";
-       FOR_EACH_PLAYER(e) {
-               centerprint(e, strcat(teamname, "^5 wins the round, all other teams were frozen.\n"));
+       if(winner != world) // just in case a winner isn't found
+       {
+               TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
+               if(winner.team == COLOR_TEAM1)
+                       teamname = "^1Red Team";
+               else if(winner.team == COLOR_TEAM2)
+                       teamname = "^4Blue Team";
+               else if(winner.team == COLOR_TEAM3)
+                       teamname = "^3Yellow Team";
+               else
+                       teamname = "^6Pink Team";
+               FOR_EACH_PLAYER(e) {
+                       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");
        }
-       bprint(teamname, "^5 wins the round since all the other teams were frozen.\n");
 
        next_round = time + 5;
 }
@@ -147,6 +151,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
 {
        if(time > warmup) // spawn too late, freeze player
        {
+               print("time: ", ftos(time), " warmup: ", ftos(warmup), "\n");
                centerprint(self, "^1You spawned after the round started, you'll spawn as frozen.\n");
                freezetag_Freeze();
        }