+#include "round_handler.qh"
+
+#include "command/vote.qh"
+#include "../common/util.qh"
+
void round_handler_Think()
-{
+{SELFPARAM();
float f;
if(time < game_starttime)
if(self.wait)
{
- self.wait = FALSE;
+ self.wait = false;
self.cnt = self.count + 1; // init countdown
round_starttime = time + self.count;
- reset_map(TRUE);
+ reset_map(true);
}
if(self.cnt > 0) // countdown running
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();
if(self.canRoundEnd())
{
// schedule a new round
- self.wait = TRUE;
+ self.wait = true;
self.nextthink = time + self.delay;
}
else
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
round_handler.canRoundStart = canRoundStart_func;
round_handler.canRoundEnd = canRoundEnd_func;
round_handler.roundStart = roundStart_func;
- round_handler.wait = FALSE;
+ round_handler.wait = false;
round_handler_Init(5, 5, 180);
round_handler.nextthink = time;
}
void round_handler_Reset(float next_think)
{
- round_handler.wait = FALSE;
+ round_handler.wait = false;
if(round_handler.count)
if(round_handler.cnt < round_handler.count + 1)
round_handler.cnt = round_handler.count + 1;