From a67f324b912496d202d1730640288a6d9720efeb Mon Sep 17 00:00:00 2001 From: NoM0Re <1629787+NoM0Re@users.noreply.github.com> Date: Fri, 7 Nov 2025 00:58:51 +0100 Subject: [PATCH] (fix/SpellCache): correct rebuild condition to avoid constant rebuilding (cherry picked from commit 08b47ad7ad3848054e4764bec9dae2dc22b24aa3) --- WeakAurasOptions/Cache.lua | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/WeakAurasOptions/Cache.lua b/WeakAurasOptions/Cache.lua index 413d78a..61808d1 100644 --- a/WeakAurasOptions/Cache.lua +++ b/WeakAurasOptions/Cache.lua @@ -110,20 +110,19 @@ local misses = 0 local lastId print("####") while misses < 4000000 do - id = id + 1 - local name = GetSpellInfo(id) - local icon = GetSpellTexture(id) - if (icon == "Interface\\Icons\\trade_engineering") then -- 136243 is the a gear icon, we can ignore those spells - misses = 0 - elseif name and name ~= "" and icon then - if misses > 10000 then - print(("holes[%s] = %s"):format(lastId, id - 1)) - end - lastId = id - misses = 0 - else - misses = misses + 1 - end + id = id + 1 + local name, _, icon = GetSpellInfo(id) + if (icon and icon:lower() == "interface\\icons\\trade_engineering") then -- 136243 is the a gear icon, we can ignore those spells + misses = 0 + elseif name and name ~= "" and icon then + if misses > 10000 then + print(("holes[%s] = %s"):format(lastId, id - 1)) + end + lastId = id + misses = 0 + else + misses = misses + 1 + end end print("lastId", lastId) ]] @@ -214,7 +213,7 @@ function spellCache.Load(data) num = num + 1; end - if(num < 39000 or metaData.locale ~= locale or metaData.build ~= build + if(num < 16000 or metaData.locale ~= locale or metaData.build ~= build or metaData.version ~= version or not metaData.spellCacheStrings) then metaData.build = build;