X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fround_handler.qc;h=d347fcbaf9be95d010a8af0378795ffe3c9fe315;hb=e7b84d1ea38e1f9af6068955a4ccd9b5fcdb2913;hp=d1302a84d7d0212ed1d1440d7bf5f9105e8fee53;hpb=fc15d72b041c9a748b605ba28735380fbe5b5b01;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index d1302a84d7..d347fcbaf9 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -1,23 +1,28 @@ #include "round_handler.qh" +#include +#include +#include "campaign.qh" #include "command/vote.qh" #include "../common/util.qh" void round_handler_Think(entity this) { - if (time < game_starttime) + if (intermission_running) { - round_handler_Reset(game_starttime); + round_handler_Reset(0); + round_handler_Remove(); return; } - if (gameover) + if (time < game_starttime) { - round_handler_Reset(0); - round_handler_Remove(); + round_handler_Reset(game_starttime); return; } + game_stopped = false; + if (this.wait) { this.wait = false; @@ -28,7 +33,7 @@ void round_handler_Think(entity this) if (this.cnt > 0) // countdown running { - if (this.canRoundStart()) + if (this.canRoundStart() && !(autocvar_g_campaign && !campaign_bots_may_start)) { if (this.cnt == this.count + 1) round_starttime = time + this.count; int f = this.cnt - 1; @@ -73,7 +78,7 @@ 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 +// game_starttime isn't initialized yet void round_handler_FirstThink(entity this) { round_starttime = max(time, game_starttime) + this.count; @@ -81,7 +86,7 @@ void round_handler_FirstThink(entity this) this.nextthink = max(time, game_starttime); } -void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, void() roundStart_func) +void round_handler_Spawn(bool() canRoundStart_func, bool() canRoundEnd_func, void() roundStart_func) { if (round_handler) { @@ -111,6 +116,6 @@ void round_handler_Reset(float next_think) void round_handler_Remove() { - remove(round_handler); + delete(round_handler); round_handler = NULL; }