X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fround_handler.qc;h=3b11c5f9b6f409e0d51948286cab7160041b3270;hb=00d96133efc93b60bda345031b7ba11e2cf74e37;hp=8fb1a787be1904edee99e5e3bd93831fb7f7194d;hpb=e9f30b97435c6afe3d6911f21e1f4fd1b97e93da;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index 8fb1a787b..3b11c5f9b 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -3,10 +3,8 @@ #include "command/vote.qh" #include "../common/util.qh" -void round_handler_Think() +void round_handler_Think(entity this) { - SELFPARAM(); - if (time < game_starttime) { round_handler_Reset(game_starttime); @@ -76,11 +74,10 @@ void round_handler_Init(float the_delay, float the_count, float the_round_timeli // NOTE: this is only needed because if round_handler spawns at time 1 // gamestarttime isn't initialized yet -void round_handler_FirstThink() +void round_handler_FirstThink(entity this) { - SELFPARAM(); round_starttime = max(time, game_starttime) + this.count; - this.think = round_handler_Think; + setthink(this, round_handler_Think); this.nextthink = max(time, game_starttime); } @@ -93,7 +90,7 @@ void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, v } entity this = round_handler = new(round_handler); - this.think = round_handler_FirstThink; + setthink(this, round_handler_FirstThink); this.canRoundStart = canRoundStart_func; this.canRoundEnd = canRoundEnd_func; this.roundStart = roundStart_func; @@ -114,6 +111,6 @@ void round_handler_Reset(float next_think) void round_handler_Remove() { - remove(round_handler); - round_handler = world; + delete(round_handler); + round_handler = NULL; }