mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 05:13:02 +05:00
cleaning
This commit is contained in:
parent
27fefd0320
commit
8d4d100218
4 changed files with 20 additions and 16 deletions
|
@ -435,7 +435,7 @@ function SWEP:PrimaryAttack()
|
||||||
|
|
||||||
ply:SetMEMoveLimit(ply:GetMEMoveLimit() * 0.75)
|
ply:SetMEMoveLimit(ply:GetMEMoveLimit() * 0.75)
|
||||||
ply:SetOverdriveMult(mult)
|
ply:SetOverdriveMult(mult)
|
||||||
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 120) * fovmult, 0.125)
|
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 100) * fovmult, 0.125)
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,7 +34,7 @@ local function FallCheck()
|
||||||
ParkourEvent("falluncontrolled", ply, true)
|
ParkourEvent("falluncontrolled", ply, true)
|
||||||
end
|
end
|
||||||
elseif ply.FallStatic and speed > -800 then
|
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:StopSound("FallStatic")
|
||||||
|
|
||||||
ply.FallStatic = false
|
ply.FallStatic = false
|
||||||
|
@ -66,7 +66,7 @@ local function FallEffect()
|
||||||
blurpass = math.min(blurpass + 0.1, 10)
|
blurpass = math.min(blurpass + 0.1, 10)
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ function syn:Think()
|
||||||
end
|
end
|
||||||
|
|
||||||
local testbuildup = false
|
local testbuildup = false
|
||||||
local testfovconvar = GetConVar("Beatrun_FOV", 110)
|
local testfovconvar = GetConVar("Beatrun_FOV", 100)
|
||||||
local testfov = 100
|
local testfov = 100
|
||||||
local colbeatr = 250
|
local colbeatr = 250
|
||||||
local colbeatg = 120
|
local colbeatg = 120
|
||||||
|
|
|
@ -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")
|
CreateConVar("cl_playerbodygroups", "0", {FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD}, "The bodygroups to use, if the model has any")
|
||||||
|
|
||||||
local lframeswepclass = lframeswepclass or ""
|
local lframeswepclass = lframeswepclass or ""
|
||||||
local fovdelaytoggle = false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if SERVER then
|
if SERVER then
|
||||||
|
@ -160,7 +159,7 @@ function PLAYER:Loadout()
|
||||||
|
|
||||||
self.Player:SetJumpPower(230)
|
self.Player:SetJumpPower(230)
|
||||||
self.Player:SetCrouchedWalkSpeed(0.5)
|
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)
|
self.Player:SetCanZoom(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -380,17 +379,19 @@ function PLAYER:CalcView(view)
|
||||||
|
|
||||||
if CLIENT then
|
if CLIENT then
|
||||||
-- VERY hacky and dirty code and I apologize in advance
|
-- VERY hacky and dirty code and I apologize in advance
|
||||||
|
|
||||||
local fov = GetConVar("Beatrun_FOV"):GetInt()
|
local fov = GetConVar("Beatrun_FOV"):GetInt()
|
||||||
|
|
||||||
if IsValid(LocalPlayer():GetActiveWeapon()) then
|
if IsValid(LocalPlayer():GetActiveWeapon()) then
|
||||||
if lframeswepclass != LocalPlayer():GetActiveWeapon():GetClass() then
|
if lframeswepclass ~= LocalPlayer():GetActiveWeapon():GetClass() then
|
||||||
-- SP clientside weapon swap detection
|
-- SP clientside weapon swap detection
|
||||||
FOVModifierBlock = true
|
FOVModifierBlock = true
|
||||||
timer.Simple(1, function() FOVModifierBlock = false end)
|
|
||||||
|
timer.Simple(1, function()
|
||||||
|
FOVModifierBlock = false
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
if !FOVModifierBlock and !LocalPlayer():GetActiveWeapon().ARC9 then
|
if not FOVModifierBlock and not LocalPlayer():GetActiveWeapon().ARC9 then
|
||||||
fixfovmult = view.fov / fov
|
fixfovmult = view.fov / fov
|
||||||
else
|
else
|
||||||
fixfovmult = 1
|
fixfovmult = 1
|
||||||
|
@ -558,12 +559,13 @@ hook.Add("PlayerSpawn", "ResetStateTransition", function(ply, transition)
|
||||||
end)
|
end)
|
||||||
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
|
-- This ENTIRE hook is for dealing with ARC9's stupid FOV reset
|
||||||
-- behavior after switching away from an ARC9 SWEP.
|
-- 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()
|
timer.Simple(0, function()
|
||||||
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 120))
|
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 100))
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -572,9 +574,11 @@ cvars.AddChangeCallback("Beatrun_FOV", function(convar, oldval, newval)
|
||||||
LocalPlayer():SetFOV(newval)
|
LocalPlayer():SetFOV(newval)
|
||||||
elseif CLIENT then
|
elseif CLIENT then
|
||||||
FOVModifierBlock = true
|
FOVModifierBlock = true
|
||||||
timer.Create("beatrunfovdelay", 0.16, 1, function()
|
|
||||||
|
timer.Simple(0.16, function()
|
||||||
FOVModifierBlock = false
|
FOVModifierBlock = false
|
||||||
if !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()
|
||||||
|
@ -586,7 +590,7 @@ end)
|
||||||
|
|
||||||
if SERVER then
|
if SERVER then
|
||||||
net.Receive("Beatrun_ClientFOVChange", function(len, ply)
|
net.Receive("Beatrun_ClientFOVChange", function(len, ply)
|
||||||
ply:SetFOV((net.ReadInt(16)))
|
ply:SetFOV(net.ReadInt(16))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue