Something for thin ledges (but I don't like them)

This commit is contained in:
Fesiug 2023-11-14 22:34:58 -05:00
parent 8e5eef9f52
commit 012a8472fe
1 changed files with 19 additions and 12 deletions

View File

@ -22,7 +22,9 @@ function VaultReady( ply, pos, ang, forw, side )
if ply:NoclippingAndNotVaulting() then return false end if ply:NoclippingAndNotVaulting() then return false end
local wantdir = Vector( forw, -side, 0 ):GetNormalized() local wantdir = Vector( forw, -side, 0 ):GetNormalized()
wantdir:Rotate( Angle( 0, ang.y, 0 ) ) wantdir:Rotate( Angle( 0, ang.y, 0 ) )
local cum = pos + wantdir*16
for i=1, 2 do
local cum = pos + wantdir*(((2-i)/2)*14)
local ts, te = cum + Vector( 0, 0, 22 ), cum + Vector( 0, 0, 65 ) local ts, te = cum + Vector( 0, 0, 22 ), cum + Vector( 0, 0, 65 )
local bottom, top = ply:GetHull() local bottom, top = ply:GetHull()
@ -34,8 +36,13 @@ function VaultReady( ply, pos, ang, forw, side )
maxs = top, maxs = top,
filter = ply, filter = ply,
} ) } )
local accept = (ply:GetVaultDebuff() == 0 and tr.Hit and tr.StartSolid and !tr.AllSolid and tr.FractionLeftSolid>0)
if accept then
return tr, ts, te
end
end
return (ply:GetVaultDebuff() == 0 and tr.Hit and tr.StartSolid and !tr.AllSolid and tr.FractionLeftSolid>0) and tr, ts, te or false return false
end end
hook.Add( "SetupMove", "Benny_SetupMove", function( ply, mv, cmd ) hook.Add( "SetupMove", "Benny_SetupMove", function( ply, mv, cmd )