Skip to content

Commit

Permalink
Update gmod_wire_cameracontroller.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
unknao committed Jan 23, 2025
1 parent 77ae270 commit bc54cac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lua/entities/gmod_wire_cameracontroller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ if CLIENT then
local oldcurdistance = 0

Check warning on line 57 in lua/entities/gmod_wire_cameracontroller.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: oldcurdistance
local smoothdistance = 0
local maxdistance = 16000
local adjustmaxdistance = false

local zoomdistance = 0
local zoombind = 0
Expand Down Expand Up @@ -154,9 +155,10 @@ if CLIENT then
local ang_speed = pos_speed - 2

Check warning on line 155 in lua/entities/gmod_wire_cameracontroller.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: ang_speed

if AllowZoom then
if zoombind ~= 0 then
if zoombind ~= 0 or adjustmaxdistance then
zoomdistance = math.Clamp(zoomdistance + zoombind * FrameTime() * 100 * max((abs(curdistance) + abs(zoomdistance))/10,10),0,math.min(16000-curdistance, maxdistance))
zoombind = 0
adjustmaxdistance = false
end
curdistance = curdistance + zoomdistance
end
Expand Down Expand Up @@ -270,9 +272,8 @@ if CLIENT then
-- distance
distance = math.Clamp(net.ReadFloat(),-16000,16000)
maxdistance = net.ReadFloat()

if AutoMove and AllowZoom then
zoombind = 1
if AllowZoom and AutoMove then
adjustmaxdistance = true
end

-- Parent
Expand Down

0 comments on commit bc54cac

Please sign in to comment.