diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2017-03-03 04:09:35 -0500 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2017-03-03 04:09:35 -0500 |
| commit | 27ee4ff99b05dc11ac7b77f68a05f6e40f673d5f (patch) | |
| tree | 29807a633ca92eaab3bc7e76db2a9c1aa2128794 /gamemode/shared | |
| parent | 4fb0abf05e9d42ebb59e669178db180fed7c3907 (diff) | |
| download | wintersurvival2-27ee4ff99b05dc11ac7b77f68a05f6e40f673d5f.tar.gz wintersurvival2-27ee4ff99b05dc11ac7b77f68a05f6e40f673d5f.tar.bz2 wintersurvival2-27ee4ff99b05dc11ac7b77f68a05f6e40f673d5f.zip | |
Fixed error when weapon does not have a holdtype
Diffstat (limited to 'gamemode/shared')
| -rw-r--r-- | gamemode/shared/weaponswap.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gamemode/shared/weaponswap.lua b/gamemode/shared/weaponswap.lua index aa82d53..81e21e5 100644 --- a/gamemode/shared/weaponswap.lua +++ b/gamemode/shared/weaponswap.lua @@ -84,7 +84,8 @@ if (CLIENT) then if (!IsValid(wep)) then return end
- if (pl.Weapons and pl.Weapons[pl.Select]) then wep:SetWeaponHoldType(pl.Weapons[pl.Select].Item.HoldType)
+ if (pl.Weapons and pl.Weapons[pl.Select] and pl.Weapons[pl.Select].Item and pl.Weapons[pl.Select].Item.HoldType) then
+ wep:SetWeaponHoldType(pl.Weapons[pl.Select].Item.HoldType)
else wep:SetWeaponHoldType("normal") end
end)
|
