]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/round_handler.qc
Merge branch 'master' into Mario/rifle_arena
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / round_handler.qc
index 65de5b44fb94c7a3fd67fb6e879bbcdacf53a8d3..af69e8e9e55d30a826f56d4bb6d78c384435ff39 100644 (file)
@@ -2,6 +2,12 @@ void round_handler_Think()
 {
        float f;
 
+       if(time < game_starttime)
+       {
+               round_handler_Reset(game_starttime);
+               return;
+       }
+
        if(gameover)
        {
                round_handler_Reset(0);
@@ -27,7 +33,7 @@ void round_handler_Think()
                        if(f == 0)
                        {
                                self.cnt = 0;
-                               self.round_endtime = time + self.round_timelimit;
+                               self.round_endtime = (self.round_timelimit) ? time + self.round_timelimit : 0;
                                self.nextthink = time;
                                if(self.roundStart)
                                        self.roundStart();
@@ -61,7 +67,7 @@ void round_handler_Init(float the_delay, float the_count, float the_round_timeli
        round_handler.delay = (the_delay > 0) ? the_delay : 0;
        round_handler.count = fabs(floor(the_count));
        round_handler.cnt = round_handler.count + 1;
-       round_handler.round_timelimit = max(10, the_round_timelimit);
+       round_handler.round_timelimit = (the_round_timelimit > 0) ? the_round_timelimit : 0;
 }
 
 // NOTE: this is only needed because if round_handler spawns at time 1