This commit is contained in:
Jonny_Bro (Nikita) 2024-06-08 17:07:08 +05:00
parent 27fefd0320
commit 8d4d100218
No known key found for this signature in database
GPG key ID: 3F1ECC04147E9BD8
4 changed files with 20 additions and 16 deletions

View file

@ -435,7 +435,7 @@ function SWEP:PrimaryAttack()
ply:SetMEMoveLimit(ply:GetMEMoveLimit() * 0.75)
ply:SetOverdriveMult(mult)
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 120) * fovmult, 0.125)
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 100) * fovmult, 0.125)
return
end

View file

@ -34,7 +34,7 @@ local function FallCheck()
ParkourEvent("falluncontrolled", ply, true)
end
elseif ply.FallStatic and speed > -800 then
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 120))
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 100))
ply:StopSound("FallStatic")
ply.FallStatic = false
@ -66,7 +66,7 @@ local function FallEffect()
blurpass = math.min(blurpass + 0.1, 10)
end
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 120) + math.Rand(0, CamShakeMult * 2.5))
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 100) + math.Rand(0, CamShakeMult * 2.5))
end
end

View file

@ -104,7 +104,7 @@ function syn:Think()
end
local testbuildup = false
local testfovconvar = GetConVar("Beatrun_FOV", 110)
local testfovconvar = GetConVar("Beatrun_FOV", 100)
local testfov = 100
local colbeatr = 250
local colbeatg = 120

View file

@ -9,7 +9,6 @@ if CLIENT then
CreateConVar("cl_playerbodygroups", "0", {FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD}, "The bodygroups to use, if the model has any")
local lframeswepclass = lframeswepclass or ""
local fovdelaytoggle = false
end
if SERVER then
@ -160,7 +159,7 @@ function PLAYER:Loadout()
self.Player:SetJumpPower(230)
self.Player:SetCrouchedWalkSpeed(0.5)
self.Player:SetFOV(self.Player:GetInfoNum("Beatrun_FOV", 120))
self.Player:SetFOV(self.Player:GetInfoNum("Beatrun_FOV", 100))
self.Player:SetCanZoom(false)
end
@ -380,17 +379,19 @@ function PLAYER:CalcView(view)
if CLIENT then
-- VERY hacky and dirty code and I apologize in advance
local fov = GetConVar("Beatrun_FOV"):GetInt()
if IsValid(LocalPlayer():GetActiveWeapon()) then
if lframeswepclass != LocalPlayer():GetActiveWeapon():GetClass() then
if lframeswepclass ~= LocalPlayer():GetActiveWeapon():GetClass() then
-- SP clientside weapon swap detection
FOVModifierBlock = true
timer.Simple(1, function() FOVModifierBlock = false end)
timer.Simple(1, function()
FOVModifierBlock = false
end)
end
if !FOVModifierBlock and !LocalPlayer():GetActiveWeapon().ARC9 then
if not FOVModifierBlock and not LocalPlayer():GetActiveWeapon().ARC9 then
fixfovmult = view.fov / fov
else
fixfovmult = 1
@ -558,12 +559,13 @@ hook.Add("PlayerSpawn", "ResetStateTransition", function(ply, transition)
end)
end)
hook.Add("PlayerSwitchWeapon", "BeatrunSwitchFOVFix", function(ply)
hook.Add("PlayerSwitchWeapon", "BeatrunSwitchARC9FOVFix", function(ply)
-- This ENTIRE hook is for dealing with ARC9's stupid FOV reset
-- behavior after switching away from an ARC9 SWEP.
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 120))
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 100))
timer.Simple(0, function()
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 120))
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 100))
end)
end)
@ -572,9 +574,11 @@ cvars.AddChangeCallback("Beatrun_FOV", function(convar, oldval, newval)
LocalPlayer():SetFOV(newval)
elseif CLIENT then
FOVModifierBlock = true
timer.Create("beatrunfovdelay", 0.16, 1, function()
timer.Simple(0.16, function()
FOVModifierBlock = false
if !FOVModifierBlock then
if not FOVModifierBlock then
net.Start("Beatrun_ClientFOVChange")
net.WriteInt(newval, 16)
net.SendToServer()
@ -586,7 +590,7 @@ end)
if SERVER then
net.Receive("Beatrun_ClientFOVChange", function(len, ply)
ply:SetFOV((net.ReadInt(16)))
ply:SetFOV(net.ReadInt(16))
end)
end