From: Mario Date: Sat, 7 Jan 2017 00:15:03 +0000 (+1000) Subject: Properly unassign hook from player's weapon entity on client side (may fix crouching... X-Git-Tag: xonotic-v0.8.2~317 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3b69c908074b343db26b335066a6b50fae81fee1;p=xonotic%2Fxonotic-data.pk3dir.git Properly unassign hook from player's weapon entity on client side (may fix crouching issues) --- 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)