mirror of
https://github.com/HaodongMo/ARC-9.git
synced 2025-03-04 03:02:58 -05:00
attempt at clearing long cache in ubgl 2 revert if not working
This commit is contained in:
parent
d19a5b0e92
commit
018acb2f0d
@ -30,13 +30,16 @@ local quickmodifiers = {
|
||||
local singleplayer = game.SinglePlayer()
|
||||
local ARC9HeatCapacityGPVOverflow = false
|
||||
|
||||
function SWEP:ClearLongCache()
|
||||
for _, v in pairs(self.PV_CacheLong) do v.time = 0 end
|
||||
end
|
||||
|
||||
function SWEP:InvalidateCache()
|
||||
if singleplayer and self:GetOwner():IsPlayer() then
|
||||
self:CallOnClient("InvalidateCache")
|
||||
end
|
||||
|
||||
for _, v in pairs(self.PV_CacheLong) do v.time = 0 end
|
||||
-- self.PV_CacheLong = {}
|
||||
self:ClearLongCache()
|
||||
|
||||
self.StatCache = {}
|
||||
self.HookCache = {}
|
||||
|
@ -27,6 +27,8 @@ function SWEP:ThinkUBGL()
|
||||
end
|
||||
end
|
||||
|
||||
local singleplayer = game.SinglePlayer()
|
||||
|
||||
function SWEP:ToggleUBGL(on)
|
||||
if on == nil then on = !self:GetUBGL() end
|
||||
if self:GetReloading() then on = false end
|
||||
@ -41,8 +43,11 @@ function SWEP:ToggleUBGL(on)
|
||||
self:CancelReload()
|
||||
self:SetUBGL(on)
|
||||
|
||||
for _, v in pairs(self.PV_CacheLong) do v.time = 0 end -- reset cache so ubgl stats wont mix with normal gun
|
||||
|
||||
if singleplayer and self:GetOwner():IsPlayer() then
|
||||
self:CallOnClient("ClearLongCache")
|
||||
end
|
||||
self:ClearLongCache()
|
||||
|
||||
if on then
|
||||
local soundtab = {
|
||||
name = "enterubgl",
|
||||
@ -55,7 +60,7 @@ function SWEP:ToggleUBGL(on)
|
||||
self:PlayAnimation("enter_ubgl", 1, true)
|
||||
self:ExitSights()
|
||||
|
||||
if game.SinglePlayer() then
|
||||
if singleplayer then
|
||||
self:CallOnClient("RecalculateIKGunMotionOffset")
|
||||
end
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user