From: Samual Date: Mon, 2 Apr 2012 15:51:57 +0000 (-0400) Subject: Gameover check is not needed in matchend hook X-Git-Tag: xonotic-v0.7.0~240^2~91 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=96b7e70131aeb86bbc2312c51a566e44074d842b;p=xonotic%2Fxonotic-data.pk3dir.git Gameover check is not needed in matchend hook --- diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 8613cecba..7a905a0b7 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -1112,32 +1112,29 @@ MUTATOR_HOOKFUNCTION(ctf_MatchEnd) { entity flag; // temporary entity for the search method - if(gameover) // is this necessary? + for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) { - for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) + switch(flag.ctf_status) { - switch(flag.ctf_status) + case FLAG_DROPPED: + case FLAG_PASSING: { - case FLAG_DROPPED: - case FLAG_PASSING: - { - // lock the flag, game is over - flag.movetype = MOVETYPE_NONE; - flag.takedamage = DAMAGE_NO; - flag.solid = SOLID_NOT; - flag.nextthink = 0; // stop thinking - - print("stopping the ", flag.netname, " from moving.\n"); - break; - } + // lock the flag, game is over + flag.movetype = MOVETYPE_NONE; + flag.takedamage = DAMAGE_NO; + flag.solid = SOLID_NOT; + flag.nextthink = 0; // stop thinking - default: - case FLAG_BASE: - case FLAG_CARRY: - { - // do nothing for these flags - break; - } + print("stopping the ", flag.netname, " from moving.\n"); + break; + } + + default: + case FLAG_BASE: + case FLAG_CARRY: + { + // do nothing for these flags + break; } } }