From afd509d6ce78700c0fc786af94179488c2ebc58b Mon Sep 17 00:00:00 2001 From: relaxtakenotes <134127331+jeffthekillerz@users.noreply.github.com> Date: Thu, 8 Jun 2023 21:38:33 +0500 Subject: [PATCH] disable firstperson body anims if in thirdperson --- beatrun/gamemodes/beatrun/gamemode/cl/BodyAnim.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/BodyAnim.lua b/beatrun/gamemodes/beatrun/gamemode/cl/BodyAnim.lua index 2881344..dcad126 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/BodyAnim.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/BodyAnim.lua @@ -459,6 +459,7 @@ local lerpedpos = Vector() local lastlockang = false local lastlockangstart = Angle() local lasteyeang = Angle() +local updatethirdpersonshit = true -- local lerpedang = Vector() function BodyAnimCalcView2(ply, pos, angles, fov) @@ -468,6 +469,19 @@ function BodyAnimCalcView2(ply, pos, angles, fov) return 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) then if followplayer then