X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fctf.qc;h=690231b605c90b0728e4d99f24d4fe040324a94f;hb=136bde75f76430926f45692fc783f12f053c3b1e;hp=8c0844b2246f26107bfccc482bfaed52909f65ce;hpb=cb78214cf1252fa80df3490c0cd3d41bae72bbb8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/ctf.qc b/qcsrc/server/ctf.qc index 8c0844b22..690231b60 100644 --- a/qcsrc/server/ctf.qc +++ b/qcsrc/server/ctf.qc @@ -1058,42 +1058,40 @@ void ctf_setstatus() self.items &~= IT_BLUE_FLAG_LOST; self.items &~= IT_CTF_SHIELDED; - if (g_ctf) { - local entity flag; - float redflags, blueflags; + local entity flag; + float redflags, blueflags; - if(self.ctf_captureshielded) - self.items |= IT_CTF_SHIELDED; + if(self.ctf_captureshielded) + self.items |= IT_CTF_SHIELDED; - redflags = 0; - blueflags = 0; + redflags = 0; + blueflags = 0; - for (flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) if(flag.cnt != FLAG_BASE) - { - if(flag.items & IT_KEY2) // blue - ++redflags; - else if(flag.items & IT_KEY1) // red - ++blueflags; - } + for (flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) if(flag.cnt != FLAG_BASE) + { + if(flag.items & IT_KEY2) // blue + ++redflags; + else if(flag.items & IT_KEY1) // red + ++blueflags; + } - // blinking magic: if there is more than one flag, show one of these in a clever way - if(redflags) - redflags = mod(floor(time * redflags * 0.75), redflags); - if(blueflags) - blueflags = mod(floor(time * blueflags * 0.75), blueflags); + // blinking magic: if there is more than one flag, show one of these in a clever way + if(redflags) + redflags = mod(floor(time * redflags * 0.75), redflags); + if(blueflags) + blueflags = mod(floor(time * blueflags * 0.75), blueflags); - for (flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) if(flag.cnt != FLAG_BASE) + for (flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) if(flag.cnt != FLAG_BASE) + { + if(flag.items & IT_KEY2) // blue { - if(flag.items & IT_KEY2) // blue - { - if(--redflags == -1) // happens exactly once (redflags is in 0..count-1, and will --'ed count times) - ctf_setstatus2(flag, IT_RED_FLAG_TAKEN); - } - else if(flag.items & IT_KEY1) // red - { - if(--blueflags == -1) // happens exactly once - ctf_setstatus2(flag, IT_BLUE_FLAG_TAKEN); - } + if(--redflags == -1) // happens exactly once (redflags is in 0..count-1, and will --'ed count times) + ctf_setstatus2(flag, IT_RED_FLAG_TAKEN); + } + else if(flag.items & IT_KEY1) // red + { + if(--blueflags == -1) // happens exactly once + ctf_setstatus2(flag, IT_BLUE_FLAG_TAKEN); } } };