From: Rudolf Polzer Date: Fri, 17 Sep 2010 12:15:50 +0000 (+0200) Subject: electro/hook: add a safeguard to stop the sound 10 seconds after last update X-Git-Tag: xonotic-v0.1.0preview~267^2~26^2~2 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=fe3a76c784acf0438afea5b0d89eb007bf122d53 electro/hook: add a safeguard to stop the sound 10 seconds after last update --- diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 06858d597a..b22dba8258 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -63,6 +63,13 @@ void Draw_GrapplingHook() vector vs; float intensity, offset; + if(self.teleport_time) + if(time > self.teleport_time) + { + sound (self, CHAN_PROJECTILE, "misc/null.wav", VOL_BASE, ATTN_NORM); // safeguard + self.teleport_time = 0; + } + InterpolateOrigin_Do(); s = cvar("cl_gunalign"); @@ -274,6 +281,8 @@ void Ent_ReadHook(float bIsNew, float type) break; } } + + self.teleport_time = time + 10; } void Hook_Precache()