]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/arena.qc
fix a bug where a player for some reason couldn't spawn
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / arena.qc
index ee4ce1b87ed9388ca2bf376f98a437866ef21bc3..e0af005737c5ee757b8e7ce5c4bfe477bb6e9fa4 100644 (file)
@@ -122,10 +122,14 @@ void reset_map(float dorespawn)
        if(g_keyhunt)
                kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round")+(game_starttime - time), "", kh_StartRound);
 
-       if(g_arena || g_ca)
+       if(g_arena)
        if(champion && champion.classname == "player" && player_count > 1)
                UpdateFrags(champion, +1);
 
+       if(g_ca)
+       if(champion && champion.classname == "player" && player_count > 1)
+               TeamScore_AddToTeam(champion.team, SP_SCORE, 1);
+
        self = oldself;
 }
 
@@ -195,11 +199,15 @@ void Arena_Warmup()
        if((!g_arena && !g_ca) || (g_arena && !arena_roundbased) || (time < game_starttime))
                return;
 
-       f = floor(warmup - time + 1);
+       f = ceil(warmup - time);
+       if(f <= 0)
+               champion = world; // this is done because a if(champion) will not execute if champion = world
 
        allowed_to_spawn = 0;
 
-       if(g_ca && (ca_players < required_ca_players || inWarmupStage))
+       if(inWarmupStage)
+               allowed_to_spawn = 1;
+       if(ca_players < required_ca_players)
                allowed_to_spawn = 1;
 
        msg = NEWLINES;
@@ -285,8 +293,6 @@ void Spawnqueue_Check()
                else if(ca_players < required_ca_players) {
                        FOR_EACH_PLAYER(self)
                                centerprint(self, strcat("^1Need at least 1 player in each team to play CA", "^7\n"));
-
-                       allowed_to_spawn = 1;
                        return;
                }
                else if(!next_round) {