From 373f482843a6a1865e395746bbce907551193026 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sat, 18 Mar 2017 16:12:42 +0100 Subject: [PATCH] bugfix --- aux-addon.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/aux-addon.lua b/aux-addon.lua index 215244d..f287209 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -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