aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorApickx <apickx@cogarr.com>2018-01-14 23:12:44 -0500
committerApickx <apickx@cogarr.com>2018-01-14 23:12:44 -0500
commit2cc0c9c3cf4571a66ba83fb4d287f739e587d26c (patch)
treed015e2ff3c0d0e923927bd33870c74b9982c5874
parentb93f8455c47be19e0af3a855c5fa5ad99b707685 (diff)
downloadwintersurvival2-2cc0c9c3cf4571a66ba83fb4d287f739e587d26c.tar.gz
wintersurvival2-2cc0c9c3cf4571a66ba83fb4d287f739e587d26c.tar.bz2
wintersurvival2-2cc0c9c3cf4571a66ba83fb4d287f739e587d26c.zip
Fix a cs bug with weapon swapping
-rw-r--r--gamemode/shared/weaponswap.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/gamemode/shared/weaponswap.lua b/gamemode/shared/weaponswap.lua
index dc3c52c..b409f5a 100644
--- a/gamemode/shared/weaponswap.lua
+++ b/gamemode/shared/weaponswap.lua
@@ -25,10 +25,11 @@ if (CLIENT) then
surface.PlaySound("wintersurvival2/hud/itemequip.wav")
if (IsValid(Wep)) then
- 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)
+ if (pl.Weapons and pl.Weapons[Num] and pl.Weapons[Num].Item and pl.Weapons[Num].Item.HoldType) then
+ print("Setting holdtype to", pl.Weapons[Num].Item.HoldType)
+ Wep:SetHoldType(pl.Weapons[Num].Item.HoldType)
else
- Wep:SetWeaponHoldType("normal")
+ Wep:SetHoldType("normal")
end
end
@@ -61,7 +62,7 @@ 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)
+ 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