]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Properly unassign hook from player's weapon entity on client side (may fix crouching...
authorMario <mario@smbclan.net>
Sat, 7 Jan 2017 00:15:03 +0000 (10:15 +1000)
committerMario <mario@smbclan.net>
Sat, 7 Jan 2017 00:15:03 +0000 (10:15 +1000)
qcsrc/common/weapons/weapon/hook.qc

index ff815d4619115869dff624b175e2f066a2c6b2fe..15dfe0169dbacf483f703f6431780395a8df9eeb 100644 (file)
@@ -501,8 +501,12 @@ void Remove_GrapplingHook(entity this)
 {
        sound (this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
 
-       if(csqcplayer && csqcplayer.hook == this)
-               csqcplayer.hook = NULL;
+       for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+       {
+               entity wep = viewmodels[slot];
+               if(wep.hook == this)
+                       wep.hook = NULL;
+       }
 }
 
 NET_HANDLE(ENT_CLIENT_HOOK, bool bIsNew)