mirror of
https://github.com/HaodongMo/ARC-9.git
synced 2025-03-04 03:02:58 -05:00
fixed tpik vm offsets
This commit is contained in:
parent
5a9e280570
commit
84a9d38e34
@ -4,6 +4,7 @@ local arc9_tpik = GetConVar("arc9_tpik")
|
||||
local arc9_tpik_others = GetConVar("arc9_tpik_others")
|
||||
local arc9_tpik_framerate = GetConVar("arc9_tpik_framerate")
|
||||
|
||||
local somevector3 = Vector(-1, -1, 1)
|
||||
local forcednotpik = ARC9.NoTPIK
|
||||
|
||||
function SWEP:ShouldTPIK()
|
||||
@ -20,7 +21,7 @@ function SWEP:ShouldTPIK()
|
||||
if self:ShouldLOD() == 2 then return end
|
||||
-- if self:GetSafe() then return 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
|
||||
|
||||
@ -36,6 +37,11 @@ function SWEP:ShouldTPIK()
|
||||
if IsValid(wm) and wm.slottbl then
|
||||
wm.slottbl.Pos = (should and self.WorldModelOffset.TPIKPos) or self.WorldModelOffset.Pos
|
||||
wm.slottbl.Ang = (should and self.WorldModelOffset.TPIKAng) or self.WorldModelOffset.Ang
|
||||
|
||||
if should and lp == owner and self.CustomizeDelta == 0 then
|
||||
wm.slottbl.Pos = wm.slottbl.Pos - self.ViewModelPos * somevector3
|
||||
wm.slottbl.Ang = wm.slottbl.Ang + Angle(self.ViewModelAng.p, -self.ViewModelAng.y, self.ViewModelAng.r)
|
||||
end
|
||||
end
|
||||
|
||||
return should
|
||||
|
@ -493,20 +493,20 @@ function SWEP:GetViewModelPosition(pos, ang)
|
||||
self.LastViewModelAng = ang
|
||||
local wm = self:GetWM()
|
||||
|
||||
if IsValid(wm) and curvedcustomizedelta == 0 then
|
||||
if !self:ShouldTPIK() then
|
||||
wm.slottbl.Pos = self.WorldModelOffset.Pos
|
||||
wm.slottbl.Ang = self.WorldModelOffset.Ang
|
||||
else
|
||||
if self.NoTPIKVMPos then
|
||||
wm.slottbl.Pos = self.WorldModelOffset.TPIKPos or self.WorldModelOffset.Pos
|
||||
wm.slottbl.Ang = self.WorldModelOffset.TPIKAng or self.WorldModelOffset.Ang
|
||||
elseif LocalPlayer() == owner then
|
||||
wm.slottbl.Pos = (self.WorldModelOffset.TPIKPos or self.WorldModelOffset.Pos) - self.ViewModelPos * somevector3
|
||||
wm.slottbl.Ang = (self.WorldModelOffset.TPIKAng or self.WorldModelOffset.Ang) + Angle(self.ViewModelAng.p, -self.ViewModelAng.y, self.ViewModelAng.r)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- if IsValid(wm) and curvedcustomizedelta == 0 then
|
||||
-- if !self:ShouldTPIK() then
|
||||
-- wm.slottbl.Pos = self.WorldModelOffset.Pos
|
||||
-- wm.slottbl.Ang = self.WorldModelOffset.Ang
|
||||
-- else
|
||||
-- if self.NoTPIKVMPos then
|
||||
-- wm.slottbl.Pos = self.WorldModelOffset.TPIKPos or self.WorldModelOffset.Pos
|
||||
-- wm.slottbl.Ang = self.WorldModelOffset.TPIKAng or self.WorldModelOffset.Ang
|
||||
-- elseif LocalPlayer() == owner then
|
||||
-- wm.slottbl.Pos = (self.WorldModelOffset.TPIKPos or self.WorldModelOffset.Pos) - self.ViewModelPos * somevector3
|
||||
-- wm.slottbl.Ang = (self.WorldModelOffset.TPIKAng or self.WorldModelOffset.Ang) + Angle(self.ViewModelAng.p, -self.ViewModelAng.y, self.ViewModelAng.r)
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
if arc9DevBenchGun:GetBool() then return self.BenchGunViewModelPos, self.BenchGunViewModelAng end
|
||||
self.BenchGunViewModelPos = pos
|
||||
|
Loading…
Reference in New Issue
Block a user