This commit is contained in:
Manuel Simon Hirsig
2017-03-18 16:12:42 +01:00
parent 427f2b9dfa
commit 373f482843
+8 -3
View File
@@ -87,10 +87,15 @@ do
end
for scope in temp-S('character', 'faction', 'realm', 'account') do
local scope = scope
M[scope .. '_data'] = function(k, v)
M[scope .. '_data'] = function(key, init)
if not cache[scope] then error('Cache not ready', 2) end
cache[scope][k] = cache[scope][k] or v or {}
return cache[scope][k]
cache[scope][key] = cache[scope][key] or {}
for k, v in init or empty do
if cache[scope][key][k] == nil then
cache[scope][key][k] = v
end
end
return cache[scope][key]
end
end
end