Merge pull request #15 from jeffthekillerz/master

This commit is contained in:
Nikita 2023-06-08 21:45:36 +05:00 committed by GitHub
commit 7d80aa64a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -459,6 +459,7 @@ local lerpedpos = Vector()
local lastlockang = false local lastlockang = false
local lastlockangstart = Angle() local lastlockangstart = Angle()
local lasteyeang = Angle() local lasteyeang = Angle()
local updatethirdpersonshit = true
-- local lerpedang = Vector() -- local lerpedang = Vector()
function BodyAnimCalcView2(ply, pos, angles, fov) function BodyAnimCalcView2(ply, pos, angles, fov)
@ -468,6 +469,19 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
return return
end end
if IsValid(BodyAnim) and pos:Distance(ply:EyePos()) > 10 then
if updatethirdpersonshit then
ply:SetNoDraw(false)
BodyAnim:SetNoDraw(true)
BodyAnim:SetRenderOrigin(pos*1000)
updatethirdpersonshit = false
end
return
else
updatethirdpersonshit = true
end
if IsValid(BodyAnim) or attach ~= nil then if IsValid(BodyAnim) or attach ~= nil then
if IsValid(BodyAnim) then if IsValid(BodyAnim) then
if followplayer then if followplayer then