]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
electro/hook: add a safeguard to stop the sound 10 seconds after last update
authorRudolf Polzer <divVerent@alientrap.org>
Fri, 17 Sep 2010 12:15:50 +0000 (14:15 +0200)
committerRudolf Polzer <divVerent@alientrap.org>
Fri, 17 Sep 2010 12:15:50 +0000 (14:15 +0200)
qcsrc/client/hook.qc

index 06858d597aa917a126e1e46cc50354458973afa0..b22dba82585a8679d5183de375a0c54354e68f4e 100644 (file)
@@ -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()