Fix model disappear when sliding at max speed

This commit is contained in:
Jonny_Bro (Nikita) 2023-07-22 13:29:57 +05:00
parent 04dea4c70f
commit 12bbbf201a
7 changed files with 25 additions and 2 deletions

View file

@ -468,7 +468,7 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
return
end
if IsValid(BodyAnim) and pos:Distance(ply:EyePos()) > 10 then
if IsValid(BodyAnim) and pos:Distance(ply:EyePos()) > 20 then -- This is the issue with disappearing model when sliding
if updatethirdperson then
ply:SetNoDraw(false)
BodyAnim:SetNoDraw(true)
@ -481,7 +481,6 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
updatethirdperson = true
end
if IsValid(BodyAnim) or attach ~= nil then
if IsValid(BodyAnim) then
if followplayer then

View file

@ -222,6 +222,30 @@ local function ClimbingThink(ply, mv, cmd)
util.TraceHull(tr)
--[[ TODO: Make this work
for i = -64, 64, 1 do
tr.endpos = tr.start + Vector(i, mins.z, maxs.z)
util.TraceHull(tr)
print(trout.Hit)
print(tr.endpos)
if not trout.Hit then
tr.start = tr.endpos
tr.endpos = tr.start - ply:GetClimbingAngle():Forward() * 20
util.TraceHull(tr)
if not trout.Hit then
ply:SetClimbingEnd(tr.endpos)
ply:SetClimbing(2)
ParkourEvent("climbheave", ply)
end
end
end
--]]
if not trout.Hit then
tr.start = ply:GetClimbingEnd()
tr.endpos = tr.start - ply:GetClimbingAngle():Forward() * 20

Binary file not shown.

Binary file not shown.