Add files via upload
This commit is contained in:
@@ -616,6 +616,20 @@ function RA:AutoScan()
|
||||
end
|
||||
|
||||
function RA:_OnUpdate(elapsed)
|
||||
-- Elapsed can arrive as a function argument, as the global arg1, or
|
||||
-- (on some 1.12 builds) not at all. Fall back to GetTime() deltas so
|
||||
-- the periodic auto-scan always advances.
|
||||
if type(elapsed) ~= "number" then elapsed = nil end
|
||||
if not elapsed and type(arg1) == "number" then elapsed = arg1 end
|
||||
if not elapsed and GetTime then
|
||||
local now = GetTime()
|
||||
if RA._lastUpdate then
|
||||
elapsed = now - RA._lastUpdate
|
||||
else
|
||||
elapsed = 0
|
||||
end
|
||||
RA._lastUpdate = now
|
||||
end
|
||||
elapsed = elapsed or 0
|
||||
RA._throttle = RA._throttle + elapsed
|
||||
RA._periodic = RA._periodic + elapsed
|
||||
@@ -856,7 +870,12 @@ ef:SetScript("OnEvent", function()
|
||||
end
|
||||
end)
|
||||
|
||||
ef:SetScript("OnUpdate", function()
|
||||
ef:SetScript("OnUpdate", function(_self, _elapsed)
|
||||
if not RA.initialized then return end
|
||||
RA:_OnUpdate(arg1)
|
||||
-- Vanilla 1.12 delivers elapsed via the global arg1; some private-server
|
||||
-- builds pass it as a positional parameter instead. Try both.
|
||||
local e = arg1
|
||||
if type(e) ~= "number" then e = _elapsed end
|
||||
if type(e) ~= "number" then e = _self end
|
||||
RA:_OnUpdate(e)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user