]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
round_handler: allow infinite round time (*round_timelimit 0) and remove 10 seconds...
authorterencehill <piuntn@gmail.com>
Wed, 10 Apr 2013 16:15:32 +0000 (18:15 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 10 Apr 2013 16:15:32 +0000 (18:15 +0200)
qcsrc/server/mutators/gamemode_arena.qc
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/round_handler.qc
qcsrc/server/round_handler.qh

index 484e641991a682facfe26ab9e64fa6904ed151f5..46b8faccc182bc60f5c8b997df036e77c0535196 100644 (file)
@@ -60,7 +60,7 @@ float Arena_CheckWinner()
 {
        entity e;
 
-       if(round_handler_GetTimeLeft() <= 0)
+       if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
        {
                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
                Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
index f00c4df39364a012c4fcee665251c63307a20d0e..11330fbd7d6b370f851aa8425bd11d0dfab4322d 100644 (file)
@@ -67,7 +67,7 @@ float CA_GetWinnerTeam()
 #define CA_ALIVE_TEAMS_OK() (CA_ALIVE_TEAMS() == ca_teams)
 float CA_CheckWinner()
 {
-       if(round_handler_GetTimeLeft() <= 0)
+       if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
        {
                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
                Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
index 3f8094e16ba2eec6bd5460dbd257b89b9f4c75ea..cfd39794f04f8d0f44a2a96f940889ae8135254e 100644 (file)
@@ -95,7 +95,7 @@ float freezetag_getWinnerTeam()
 float freezetag_CheckWinner()
 {
        entity e;
-       if(round_handler_GetTimeLeft() <= 0)
+       if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
        {
                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
                Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
index 8715a4deaa56cee9abe8d74bd4a4f4dfa8817125..af69e8e9e55d30a826f56d4bb6d78c384435ff39 100644 (file)
@@ -33,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();
@@ -67,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
index 48803113f86e9f6bf03b37236aa969fc3d97fb14..22a91dc2c6dca767072fca80c2575c1fa3c4a2e1 100644 (file)
@@ -19,5 +19,5 @@ void round_handler_Remove();
 #define round_handler_AwaitingNextRound() (round_handler.wait)
 #define round_handler_CountdownRunning() (!round_handler.wait && round_handler.cnt)
 #define round_handler_IsRoundStarted() (!round_handler.wait && !round_handler.cnt)
-#define round_handler_GetTimeLeft() (round_handler.round_endtime - time)
+#define round_handler_GetEndTime() (round_handler.round_endtime)