Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(binoculars): Allow zooming to be predicted #1696

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Fixed client error for a not fully initialized client (by @Histalek)
- Fixed the targetID corpse hint not respecting `ttt_identify_body_woconfirm` (by @Histalek)
- Fixed the beacon not being properly translated when placed (by @Histalek)
- Fixed binoculars zooming not being predicted (by @Histalek)
- Fixed an error when trying to pickup a placed equipment (e.g. beacon) (by @Histalek)

### Changed
Expand Down
11 changes: 4 additions & 7 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_binoculars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,12 @@ end
---
-- @ignore
function SWEP:SetZoomLevel(level)
if CLIENT then
return
end

local owner = self:GetOwner()

self:SetZoomAmount(level)

owner:SetFOV(self.ZoomLevels[level], 0.3)
local owner = self:GetOwner()
if IsValid(owner) then
owner:SetFOV(self.ZoomLevels[level], 0.3)
end
end

---
Expand Down
Loading