Skip to content

Commit

Permalink
use both weapon.HoldType and weapon:GetHoldType() (#529)
Browse files Browse the repository at this point in the history
* use both weapon.HoldType and weapon:GetHoldType()
  • Loading branch information
homonovus authored and kiobu committed Sep 8, 2019
1 parent 25f3555 commit 13bf9e7
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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");
Clockwork.animation:AddCivilProtectionModel("models/police.mdl");

0 comments on commit 13bf9e7

Please # to comment.