Skip to content

Commit cd3a1c1

Browse files
authored
Fixed nil value error for ironsights (#1863)
1 parent 2559440 commit cd3a1c1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
2424
- Fixed vFire explosions still killing players with `NoExplosionDamage` equipped (by @TW1STaL1CKY)
2525
- Fixed vFire explosions sometimes not damaging entities in the way they should, like explosive barrels (by @TW1STaL1CKY)
2626
- Fixed an issue where overhead icons from `TTT2ModifyOverheadIcon` were ignored when `shouldDrawDefault` was false (by @mexikoedi)
27+
- Fixed `SetIronsights` nil value error (by @mexikoedi)
2728

2829
### Removed / Breaking Changes
2930

gamemodes/terrortown/entities/weapons/weapon_tttbase.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,8 +1673,13 @@ hook.Add("KeyRelease", "TTT2ResetIronSights", function(ply, key)
16731673
return
16741674
end
16751675

1676-
wep:SetIronsights(false)
1677-
wep:SetZoom(false)
1676+
if wep.SetIronsights then
1677+
wep:SetIronsights(false)
1678+
end
1679+
1680+
if wep.SetZoom then
1681+
wep:SetZoom(false)
1682+
end
16781683
end)
16791684

16801685
if CLIENT then

0 commit comments

Comments
 (0)