validity checks + better Hook_BlockTPIK

This commit is contained in:
Darsu 2025-02-28 20:00:52 +07:00
parent 027b4296ec
commit f5457f42ab
4 changed files with 10 additions and 3 deletions

View File

@ -195,6 +195,7 @@ function SWEP:DrawFlashlightsVM()
local owner = self:GetOwner()
local lp = LocalPlayer()
if !IsValid(owner) then return end
local eyepos = owner:EyePos()
local anydrawn = false

View File

@ -22,7 +22,6 @@ function SWEP:ShouldTPIK()
-- if self:GetSafe() then return end
-- if self:GetBlindFireAmount() > 0 then return false end
if lp == owner and !owner:ShouldDrawLocalPlayer() then return end
if self:RunHook("Hook_BlockTPIK") then return end
-- if !arc9_tpik:GetBool() then return false end
local should = false
@ -32,6 +31,8 @@ function SWEP:ShouldTPIK()
else
should = arc9_tpik:GetBool()
end
if self:RunHook("Hook_BlockTPIK") then should = false end
local wm = self:GetWM()
if IsValid(wm) and wm.slottbl then

View File

@ -133,6 +133,7 @@ function SWEP:PreDrawViewModel()
local bipodamount = self:GetBipodAmount()
local vm = self:GetVM()
if !IsValid(vm) then return end
if self.HasSightsPoseparam then
vm:SetPoseParameter("sights", math.max(sightamount, bipodamount, custdelta))
@ -203,13 +204,16 @@ function SWEP:ViewModelDrawn()
self:DrawFlashlightsVM()
self:DrawLasers(false)
self:GetVM():SetMaterial("")
local vm = self:GetVM()
if !IsValid(vm) then return end
vm:SetMaterial("")
for ind = 0, 31 do
self:GetVM():SetSubMaterial(ind, "")
vm:SetSubMaterial(ind, "")
end
end
function SWEP:PostDrawViewModel()
if !IsValid(self:GetVM()) then return end
local inrt = ARC9.RTScopeRender
local newmzpcfs = {}

View File

@ -528,6 +528,7 @@ local arc9Fov = GetConVar("arc9_fov")
function SWEP:GetViewModelFOV()
local owner = self:GetOwner()
if !IsValid(owner) then return end
local ownerfov = owner:GetFOV()
local convarfov = arc9Fov:GetInt()
-- local curTime = UnPredictedCurTime()