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 ff815d4..15dfe01 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)