Fix invalid (S)WEP causing issues

This commit is contained in:
LostTrackpad 2024-06-06 13:34:34 +07:00
parent 5723dbed10
commit cfdf6fedac

View file

@ -378,20 +378,24 @@ function PLAYER:CalcView(view)
local fov = GetConVar("Beatrun_FOV"):GetInt() local fov = GetConVar("Beatrun_FOV"):GetInt()
if lframeswepclass != LocalPlayer():GetActiveWeapon():GetClass() then if IsValid(LocalPlayer():GetActiveWeapon()) then
-- SP clientside weapon swap detection if lframeswepclass != LocalPlayer():GetActiveWeapon():GetClass() then
FOVModifierBlock = true -- SP clientside weapon swap detection
timer.Simple(1, function() FOVModifierBlock = false end) FOVModifierBlock = true
end timer.Simple(1, function() FOVModifierBlock = false end)
end
if !FOVModifierBlock and !LocalPlayer():GetActiveWeapon().ARC9 then if !FOVModifierBlock and !LocalPlayer():GetActiveWeapon().ARC9 then
fixfovmult = view.fov / fov fixfovmult = view.fov / fov
else
fixfovmult = 1
end
view.fov = fov * mult * fixfovmult
lframeswepclass = LocalPlayer():GetActiveWeapon():GetClass()
else else
fixfovmult = 1 view.fov = fov * mult
end end
view.fov = GetConVar("Beatrun_FOV"):GetInt() * mult * fixfovmult
lframeswepclass = LocalPlayer():GetActiveWeapon():GetClass()
end end
if self.TauntCam:CalcView(view, self.Player, self.Player:IsPlayingTaunt()) then return true end if self.TauntCam:CalcView(view, self.Player, self.Player:IsPlayingTaunt()) then return true end