Skip to content

Fixed nil value error for ironsights#1863

Merged
saibotk merged 1 commit intoTTT-2:masterfrom
mexikoedi:fix-ironsights-nil-error
Mar 8, 2026
Merged

Fixed nil value error for ironsights#1863
saibotk merged 1 commit intoTTT-2:masterfrom
mexikoedi:fix-ironsights-nil-error

Conversation

@mexikoedi
Copy link
Contributor

This PR fixes the following error:

[TTT2 (Base) - v0.14.5b] gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:1676: attempt to call method 'SetIronsights' (a nil value)
  1. fn - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:1676
   2. unknown - lua/ulib/shared/hook.lua:115

The error appeared after a round ended and when a new round started.
It also makes the code more robust (also for SetZoom).

@saibotk saibotk merged commit cd3a1c1 into TTT-2:master Mar 8, 2026
4 checks passed
@mexikoedi mexikoedi deleted the fix-ironsights-nil-error branch March 8, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants