mirror of
https://github.com/HaodongMo/ARC-9.git
synced 2025-03-04 03:02:58 -05:00
validity checks + better Hook_BlockTPIK
This commit is contained in:
parent
027b4296ec
commit
f5457f42ab
@ -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
|
||||
|
@ -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
|
||||
@ -33,6 +32,8 @@ function SWEP:ShouldTPIK()
|
||||
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
|
||||
wm.slottbl.Pos = (should and self.WorldModelOffset.TPIKPos) or self.WorldModelOffset.Pos
|
||||
|
@ -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 = {}
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user