mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 21:33:02 +05:00
Fix FOV...hopefully finally
This commit is contained in:
parent
5ef56f4d70
commit
6e24708ecd
1 changed files with 18 additions and 15 deletions
|
@ -568,23 +568,26 @@ hook.Add("PlayerSwitchWeapon", "BeatrunSwitchARC9FOVFix", function(ply)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
cvars.AddChangeCallback("Beatrun_FOV", function(convar, oldval, newval)
|
hook.Add("InitPostEntity", "FOVChangeFix", function()
|
||||||
if CLIENT and game.SinglePlayer() then
|
-- FOV change fix, don't tinker with this unless you know what you're doing...
|
||||||
LocalPlayer():SetFOV(newval)
|
cvars.AddChangeCallback("Beatrun_FOV", function(convar, oldval, newval)
|
||||||
elseif CLIENT then
|
if CLIENT and game.SinglePlayer() then
|
||||||
FOVModifierBlock = true
|
LocalPlayer():SetFOV(newval)
|
||||||
|
elseif CLIENT then
|
||||||
|
FOVModifierBlock = true
|
||||||
|
|
||||||
timer.Simple(0.16, function()
|
timer.Simple(0.16, function()
|
||||||
FOVModifierBlock = false
|
FOVModifierBlock = false
|
||||||
|
|
||||||
if not FOVModifierBlock then
|
if not FOVModifierBlock then
|
||||||
net.Start("Beatrun_ClientFOVChange")
|
net.Start("Beatrun_ClientFOVChange")
|
||||||
net.WriteInt(newval, 16)
|
net.WriteInt(newval, 16)
|
||||||
net.SendToServer()
|
net.SendToServer()
|
||||||
FOVModifierBlock = true
|
FOVModifierBlock = true
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if SERVER then
|
if SERVER then
|
||||||
|
|
Loading…
Reference in a new issue