From 96b7e70131aeb86bbc2312c51a566e44074d842b Mon Sep 17 00:00:00 2001 From: Samual Date: Mon, 2 Apr 2012 11:51:57 -0400 Subject: [PATCH] Gameover check is not needed in matchend hook --- qcsrc/server/mutators/gamemode_ctf.qc | 41 +++++++++++++-------------- 1 file changed, 19 insertions(+), 22 deletions(-) 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; } } } -- 2.39.2