From: FruitieX Date: Sat, 30 Oct 2010 14:55:25 +0000 (+0300) Subject: shotgun: play less ricoche sounds, this fixes performance issues for Unknown[NF] X-Git-Tag: xonotic-v0.1.0preview~199^2~1 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=3dbc0b5b9ab0f255ec91b8670aeb7cd62218f873;hp=c99dfea7284d227da23f64f8b3d2f41be10cc304 shotgun: play less ricoche sounds, this fixes performance issues for Unknown[NF] --- diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index f47077a25..c5f1ed12c 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -146,6 +146,7 @@ float w_shotgun(float req) }; #endif #ifdef CSQC +.float prevric; float w_shotgun(float req) { if(req == WR_IMPACTEFFECT) @@ -153,14 +154,15 @@ float w_shotgun(float req) vector org2; org2 = w_org + w_backoff * 2; pointparticles(particleeffectnum("shotgun_impact"), org2, w_backoff * 1000, 1); - if(!w_issilent) + if(!w_issilent && time - self.prevric > 0.25) { - if(w_random < 0.05) + if(w_random < 0.0165) sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM); - else if(w_random < 0.1) + else if(w_random < 0.033) sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM); - else if(w_random < 0.2) + else if(w_random < 0.05) sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM); + self.prevric = time; } } else if(req == WR_PRECACHE)