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 owner = self:GetOwner()
|
||||||
local lp = LocalPlayer()
|
local lp = LocalPlayer()
|
||||||
|
if !IsValid(owner) then return end
|
||||||
local eyepos = owner:EyePos()
|
local eyepos = owner:EyePos()
|
||||||
|
|
||||||
local anydrawn = false
|
local anydrawn = false
|
||||||
|
@ -22,7 +22,6 @@ function SWEP:ShouldTPIK()
|
|||||||
-- if self:GetSafe() then return end
|
-- if self:GetSafe() then return end
|
||||||
-- if self:GetBlindFireAmount() > 0 then return false end
|
-- if self:GetBlindFireAmount() > 0 then return false end
|
||||||
if lp == owner and !owner:ShouldDrawLocalPlayer() then return 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
|
-- if !arc9_tpik:GetBool() then return false end
|
||||||
|
|
||||||
local should = false
|
local should = false
|
||||||
@ -32,6 +31,8 @@ function SWEP:ShouldTPIK()
|
|||||||
else
|
else
|
||||||
should = arc9_tpik:GetBool()
|
should = arc9_tpik:GetBool()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self:RunHook("Hook_BlockTPIK") then should = false end
|
||||||
|
|
||||||
local wm = self:GetWM()
|
local wm = self:GetWM()
|
||||||
if IsValid(wm) and wm.slottbl then
|
if IsValid(wm) and wm.slottbl then
|
||||||
|
@ -133,6 +133,7 @@ function SWEP:PreDrawViewModel()
|
|||||||
|
|
||||||
local bipodamount = self:GetBipodAmount()
|
local bipodamount = self:GetBipodAmount()
|
||||||
local vm = self:GetVM()
|
local vm = self:GetVM()
|
||||||
|
if !IsValid(vm) then return end
|
||||||
|
|
||||||
if self.HasSightsPoseparam then
|
if self.HasSightsPoseparam then
|
||||||
vm:SetPoseParameter("sights", math.max(sightamount, bipodamount, custdelta))
|
vm:SetPoseParameter("sights", math.max(sightamount, bipodamount, custdelta))
|
||||||
@ -203,13 +204,16 @@ function SWEP:ViewModelDrawn()
|
|||||||
self:DrawFlashlightsVM()
|
self:DrawFlashlightsVM()
|
||||||
|
|
||||||
self:DrawLasers(false)
|
self:DrawLasers(false)
|
||||||
self:GetVM():SetMaterial("")
|
local vm = self:GetVM()
|
||||||
|
if !IsValid(vm) then return end
|
||||||
|
vm:SetMaterial("")
|
||||||
for ind = 0, 31 do
|
for ind = 0, 31 do
|
||||||
self:GetVM():SetSubMaterial(ind, "")
|
vm:SetSubMaterial(ind, "")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function SWEP:PostDrawViewModel()
|
function SWEP:PostDrawViewModel()
|
||||||
|
if !IsValid(self:GetVM()) then return end
|
||||||
local inrt = ARC9.RTScopeRender
|
local inrt = ARC9.RTScopeRender
|
||||||
|
|
||||||
local newmzpcfs = {}
|
local newmzpcfs = {}
|
||||||
|
@ -528,6 +528,7 @@ local arc9Fov = GetConVar("arc9_fov")
|
|||||||
|
|
||||||
function SWEP:GetViewModelFOV()
|
function SWEP:GetViewModelFOV()
|
||||||
local owner = self:GetOwner()
|
local owner = self:GetOwner()
|
||||||
|
if !IsValid(owner) then return end
|
||||||
local ownerfov = owner:GetFOV()
|
local ownerfov = owner:GetFOV()
|
||||||
local convarfov = arc9Fov:GetInt()
|
local convarfov = arc9Fov:GetInt()
|
||||||
-- local curTime = UnPredictedCurTime()
|
-- local curTime = UnPredictedCurTime()
|
||||||
|
Loading…
Reference in New Issue
Block a user