Skip to content

Commit

Permalink
Merge pull request #6 from CFC-Servers/airstrafe
Browse files Browse the repository at this point in the history
Make sure parachute only breaks when players go really over the speed limit.
Was breaking when they were just accelerating with airstrafe
  • Loading branch information
StrawWagen authored Jan 21, 2025
2 parents a47d521 + e0fb986 commit f99a730
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/cfc_parachutes/shared/sh_parachute.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ local cvHorizontalSpeedLimit
local cvSprintBoost
local cvHandling

local vHorizontalSpeedLimitDamageGrace = 25

local function setupConVars()
local FALL_SPEED = GetConVar( "cfc_parachute_fall_speed" )
local FALL_LERP = GetConVar( "cfc_parachute_fall_lerp" )
Expand Down Expand Up @@ -112,7 +114,10 @@ local function addHorizontalVel( ply, chute, vel, timeMult )
vel[1] = vel[1] * mult
vel[2] = vel[2] * mult
if SERVER then -- so propsurf breaks it
chute:ChuteTakeDamage( 1 )
local gracedLimit = hSpeedLimit + vHorizontalSpeedLimitDamageGrace
if hSpeedCur > gracedLimit then -- so airstrafing DOESNT break it
chute:ChuteTakeDamage( 1 )
end
end
end

Expand Down

0 comments on commit f99a730

Please sign in to comment.