From 13bf9e72a6d1bae7fa40da3276d583c7de3be93e Mon Sep 17 00:00:00 2001 From: homonovus Date: Sun, 8 Sep 2019 17:34:40 -0400 Subject: [PATCH] use both weapon.HoldType and weapon:GetHoldType() (#529) * use both weapon.HoldType and weapon:GetHoldType() --- .../clockwork/framework/libraries/sh_animation.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/upload/garrysmod/gamemodes/clockwork/framework/libraries/sh_animation.lua b/upload/garrysmod/gamemodes/clockwork/framework/libraries/sh_animation.lua index dfd01e85..6ed19faf 100644 --- a/upload/garrysmod/gamemodes/clockwork/framework/libraries/sh_animation.lua +++ b/upload/garrysmod/gamemodes/clockwork/framework/libraries/sh_animation.lua @@ -852,17 +852,14 @@ end; --]] function Clockwork.animation:GetWeaponHoldType(player, weapon) local class = string.lower(weapon:GetClass()); - local weaponTable = weapons.GetStored(class); local holdType = "fist"; if (self.holdTypes[class]) then holdType = self.holdTypes[class]; - elseif (weaponTable and weaponTable.HoldType) then - if (self.convert[weaponTable.HoldType]) then - holdType = self.convert[weaponTable.HoldType]; - else - holdType = weaponTable.HoldType; - end; + elseif (IsValid(weapon)) then + local _holdType = weapon.HoldType or weapon:GetHoldType(); + + holdType = self.convert[_holdType] or _holdType; else local act = player:Weapon_TranslateActivity(ACT_HL2MP_IDLE) or -1; @@ -1083,4 +1080,4 @@ Clockwork.animation:AddCombineOverwatchModel("models/combine_soldier_prisonguard Clockwork.animation:AddCombineOverwatchModel("models/combine_super_soldier.mdl"); Clockwork.animation:AddCombineOverwatchModel("models/combine_soldier.mdl"); -Clockwork.animation:AddCivilProtectionModel("models/police.mdl"); \ No newline at end of file +Clockwork.animation:AddCivilProtectionModel("models/police.mdl");