From: Samual Date: Sat, 31 Mar 2012 01:03:42 +0000 (-0400) Subject: Implement "FLAG_TOUCHRATE" to limit the sounds/effects used when a flag is touched... X-Git-Tag: xonotic-v0.7.0~240^2~153 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=f69bc2ad5a0aae99442dcf6ff3a87abbad7c10e2 Implement "FLAG_TOUCHRATE" to limit the sounds/effects used when a flag is touched (stops spamming of it) --- diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 2d0a4c1da3..1b8d323555 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -514,13 +514,12 @@ void ctf_FlagTouch() if(gameover) { return; } if(!self) { return; } if(other.deadflag != DEAD_NO) { return; } - if(other.classname != "player") + if((other.classname != "player") && (self.wait > time)) { // The flag just touched an object, most likely the world pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1); sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTN_NORM); return; } - else if(self.wait > time) { return; } switch(self.ctf_status) { @@ -546,6 +545,8 @@ void ctf_FlagTouch() dprint("Touch: Flag exists with no status?\n"); break; } + + self.wait = time + FLAG_TOUCHRATE; } void ctf_RespawnFlag(entity flag) diff --git a/qcsrc/server/mutators/gamemode_ctf.qh b/qcsrc/server/mutators/gamemode_ctf.qh index 63ac7a0cfd..c089b999af 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qh +++ b/qcsrc/server/mutators/gamemode_ctf.qh @@ -24,6 +24,7 @@ void spawnfunc_ctf_team(); #define FLAG_SCALE 0.6 #define FLAG_THINKRATE 0.2 +#define FLAG_TOUCHRATE 0.5 #define FLAG_DROP_OFFSET ('0 0 32') #define FLAG_CARRY_OFFSET ('-15 0 7')