Files
coa-atlasloot/AtlasLoot_Cache/CacheFunctions.lua
T
Anch e04717d340 update to version 7.3.18 (#11)
* Merged Magisters Terrace - Kael'thas Sunstriders normal/heroic pages

* update to build 7.3.18
2024-08-28 09:38:01 -07:00

34 lines
1014 B
Lua

local function CheckIfEmptyTable(table)
if next(table) then
return false
else
return true
end
end
local databaseUpdated
--Updates the ItemIDsDatabase with any missing or incorrect items
function LoadItemIDsDatabase()
if databaseUpdated then return end
--loads any items in the saved varriables cache
if AtlasLootItemCache and not CheckIfEmptyTable(AtlasLootItemCache) then
for normalID, item in pairs(AtlasLootItemCache) do
for itemDif, itemID in pairs(item) do
ItemIDsDatabase[normalID] = ItemIDsDatabase[normalID] or {}
ItemIDsDatabase[normalID][itemDif] = itemID
end
end
end
-- loads ids that have been manuely corrected
if ItemIDManuelCorrections then
for normalID, item in pairs(ItemIDManuelCorrections) do
for itemDif, itemID in pairs(item) do
ItemIDsDatabase[normalID] = ItemIDsDatabase[normalID] or {}
ItemIDsDatabase[normalID][itemDif] = itemID
end
end
end
ItemIDManuelCorrections = nil
collectgarbage("collect")
databaseUpdated = true
end