Added code to reset/initialize tables in-game
Kevin Lyles [02-13-10 - 20:09]
Added code to reset/initialize tables in-game
diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua
index a8d1dc1..b136195 100644
--- a/WeightsWatcher.lua
+++ b/WeightsWatcher.lua
@@ -228,9 +228,25 @@ local function loadGeneralInfo()
end
end
+function WeightsWatcher:ResetTables()
+ local metatable = {}
+ metatable.__index = function(tbl, key)
+ tbl[key] = setmetatable({}, metatable)
+ return tbl[key]
+ end
+
+ ww_unparsed_lines = setmetatable({}, metatable)
+ ww_ignored_lines = setmetatable({}, metatable)
+ ww_temp_ignored_lines = setmetatable({}, metatable)
+ ww_unparsed_items = setmetatable({}, metatable)
+ ww_unweighted_lines = setmetatable({}, metatable)
+end
+
function WeightsWatcher:OnInitialize()
loadGeneralInfo()
+ WeightsWatcher:ResetTables()
+
if not upgradeData("account", "ww_vars") then
return
end