Fixed "ground" roll. Enabled "Lose speed on roll" will reduce your speed based on the speed limit

This commit is contained in:
shen 2024-06-07 10:43:00 +03:00
parent cf179a2730
commit 70aebef783

View file

@ -39,11 +39,11 @@ local function SafetyRollThink(ply, mv, cmd)
vel.y = 0 vel.y = 0
local con = GetConVar("Beatrun_LoseSpeedOnRoll") local con = GetConVar("Beatrun_LoseSpeedOnRoll")
local speedLimit = GetConVar("Beatrun_SpeedLimit"):GetFloat()
if (con:GetBool()) then if (con:GetBool()) then
mv:SetVelocity(ang:Forward() * 225 + vel) mv:SetVelocity(ang:Forward() * (speedLimit / 2) + vel)
else else
local speedLimit = GetConVar("Beatrun_SpeedLimit"):GetFloat()
local max = math.max(250, math.Clamp(lastGroundSpeed, 200, speedLimit + 50)) local max = math.max(250, math.Clamp(lastGroundSpeed, 200, speedLimit + 50))
mv:SetVelocity(ang:Forward() * (max + 40)) mv:SetVelocity(ang:Forward() * (max + 40))
end end
@ -128,8 +128,6 @@ hook.Add("SetupMove", "EvadeRoll", function(ply, mv, cmd)
ply:EmitSound("Land.Concrete") ply:EmitSound("Land.Concrete")
end end
BodyAnim:SetAngles(Angle(0, ply:EyeAngles().y, 0))
if CLIENT and IsFirstTimePredicted() then if CLIENT and IsFirstTimePredicted() then
CacheBodyAnim() CacheBodyAnim()
RemoveBodyAnim() RemoveBodyAnim()