diff options
Diffstat (limited to 'gamemode/shared/weaponswap.lua')
| -rw-r--r-- | gamemode/shared/weaponswap.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gamemode/shared/weaponswap.lua b/gamemode/shared/weaponswap.lua index 81e21e5..dc3c52c 100644 --- a/gamemode/shared/weaponswap.lua +++ b/gamemode/shared/weaponswap.lua @@ -25,8 +25,11 @@ if (CLIENT) then surface.PlaySound("wintersurvival2/hud/itemequip.wav")
if (IsValid(Wep)) then
- if (pl.Weapons and pl.Weapons[Num]) then Wep:SetWeaponHoldType(pl.Weapons[Num].Item.HoldType)
- else Wep:SetWeaponHoldType("normal") end
+ if (pl.Weapons and pl.Weapons[Num] and pl.Weapons[Num].Item and pl.Weapons[Num].Item.HoldType) then
+ Wep:SetWeaponHoldType(pl.Weapons[Num].Item.HoldType)
+ else
+ Wep:SetWeaponHoldType("normal")
+ end
end
return true
|
