mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
Update gmod_wire_cameracontroller.lua (#3249)
This commit is contained in:
parent
77ae270b4e
commit
a818821ed9
@ -57,6 +57,7 @@ if CLIENT then
|
|||||||
local oldcurdistance = 0
|
local oldcurdistance = 0
|
||||||
local smoothdistance = 0
|
local smoothdistance = 0
|
||||||
local maxdistance = 16000
|
local maxdistance = 16000
|
||||||
|
local adjustmaxdistance = false
|
||||||
|
|
||||||
local zoomdistance = 0
|
local zoomdistance = 0
|
||||||
local zoombind = 0
|
local zoombind = 0
|
||||||
@ -154,9 +155,10 @@ if CLIENT then
|
|||||||
local ang_speed = pos_speed - 2
|
local ang_speed = pos_speed - 2
|
||||||
|
|
||||||
if AllowZoom then
|
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))
|
zoomdistance = math.Clamp(zoomdistance + zoombind * FrameTime() * 100 * max((abs(curdistance) + abs(zoomdistance))/10,10),0,math.min(16000-curdistance, maxdistance))
|
||||||
zoombind = 0
|
zoombind = 0
|
||||||
|
adjustmaxdistance = false
|
||||||
end
|
end
|
||||||
curdistance = curdistance + zoomdistance
|
curdistance = curdistance + zoomdistance
|
||||||
end
|
end
|
||||||
@ -270,9 +272,8 @@ if CLIENT then
|
|||||||
-- distance
|
-- distance
|
||||||
distance = math.Clamp(net.ReadFloat(),-16000,16000)
|
distance = math.Clamp(net.ReadFloat(),-16000,16000)
|
||||||
maxdistance = net.ReadFloat()
|
maxdistance = net.ReadFloat()
|
||||||
|
if AllowZoom and AutoMove then
|
||||||
if AutoMove and AllowZoom then
|
adjustmaxdistance = true
|
||||||
zoombind = 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Parent
|
-- Parent
|
||||||
|
Loading…
Reference in New Issue
Block a user