From 3b69c908074b343db26b335066a6b50fae81fee1 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 7 Jan 2017 10:15:03 +1000 Subject: [PATCH] Properly unassign hook from player's weapon entity on client side (may fix crouching issues) --- qcsrc/common/weapons/weapon/hook.qc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index ff815d461..15dfe0169 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -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) -- 2.39.2