From ab30f4c4045d1b1615bf3d415344c66c6ea7fb8b Mon Sep 17 00:00:00 2001 From: relaxtakenotes <134127331+jeffthekillerz@users.noreply.github.com> Date: Mon, 5 Jun 2023 13:28:56 +0500 Subject: [PATCH] cool fix from tfa cbob it comes in useful very often --- vmaniprework/lua/autorun/client/cl_vmanip.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/vmaniprework/lua/autorun/client/cl_vmanip.lua b/vmaniprework/lua/autorun/client/cl_vmanip.lua index b9bcfa3..9bfae03 100644 --- a/vmaniprework/lua/autorun/client/cl_vmanip.lua +++ b/vmaniprework/lua/autorun/client/cl_vmanip.lua @@ -1,5 +1,4 @@ ---[[ -N++ Protip: View > Collapse Level 1 +--[[N++ Protip: View > Collapse Level 1 More detail on stuff in lua/vmanip/vmanip_baseanims.lua Please keep in mind that you do not fire events *through vmanip*. Think of it as a fully @@ -551,6 +550,8 @@ hook.Add("PostDrawViewModel", "VManip", function(vm, ply, weapon) end end) +local anglef = Angle(0, 1, 0) + --Very basic stuff, you see hook.Add("PostDrawViewModel", "VMLegs", function(vm, ply, weapon) if VMLegs:IsActive() then @@ -627,7 +628,16 @@ hook.Add("NeedsDepthPass", "VManip_RubatPLZ", function() VManip.Attachment = att end) +local ISCALC = false hook.Add("CalcView", "VManip_Cam", function(ply, origin, angles, fov) + // we dont really care about camera manipulations from other hooks during this, thus we can ignore them. + // some important calculations can happen in calcview hooks however, so running them is important + + if ISCALC then return end + ISCALC = true + hook.Run("CalcView", ply, pos, ang, fov) + ISCALC = false + if not VManip:IsActive() or not VManip.Attachment then return end if ply:GetViewEntity() ~= ply or ply:ShouldDrawLocalPlayer() then return end local view = {}