Skip to content

Commit 0fd9b74

Browse files
committed
Update libs
1 parent 8f773b2 commit 0fd9b74

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

Libs/AceDB-3.0/AceDB-3.0.lua

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
-- end
4141
-- @class file
4242
-- @name AceDB-3.0.lua
43-
-- @release $Id: AceDB-3.0.lua 1353 2024-08-27 13:37:35Z nevcairiel $
44-
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 30
43+
-- @release $Id: AceDB-3.0.lua 1364 2025-07-05 16:01:08Z nevcairiel $
44+
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 33
4545
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
4646

4747
if not AceDB then return end -- No upgrade needed
@@ -360,7 +360,7 @@ local function logoutHandler(frame, event)
360360

361361
-- cleanup sections that are empty without defaults
362362
local sv = rawget(db, "sv")
363-
for section in pairs(db.keys) do
363+
for section in pairs(rawget(db, "keys")) do
364364
if rawget(sv, section) then
365365
-- global is special, all other sections have sub-entrys
366366
-- also don't delete empty profiles on main dbs, only on namespaces
@@ -377,6 +377,26 @@ local function logoutHandler(frame, event)
377377
end
378378
end
379379
end
380+
381+
-- second pass after everything else is cleaned up to remove empty namespaces
382+
-- can't be run in-loop above since there is no guaranteed order
383+
for db in pairs(AceDB.db_registry) do
384+
local sv = rawget(db, "sv")
385+
local namespaces = rawget(sv, "namespaces")
386+
if namespaces then
387+
for name in pairs(namespaces) do
388+
-- cleanout empty profiles table, if still present
389+
if namespaces[name].profiles and not next(namespaces[name].profiles) then
390+
namespaces[name].profiles = nil
391+
end
392+
393+
-- remove entire namespace, if needed
394+
if not next(namespaces[name]) then
395+
namespaces[name] = nil
396+
end
397+
end
398+
end
399+
end
380400
end
381401
end
382402

Libs/LibDispel/LibDispel.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local MAJOR, MINOR = "LibDispel-1.0", 15
1+
local MAJOR, MINOR = "LibDispel-1.0", 16
22
assert(LibStub, MAJOR.." requires LibStub")
33

44
local lib = LibStub:NewLibrary(MAJOR, MINOR)
@@ -13,8 +13,8 @@ local SetCVar = C_CVar.SetCVar
1313

1414
local CopyTable = CopyTable
1515
local CreateFrame = CreateFrame
16-
local IsPlayerSpell = IsPlayerSpell
17-
local IsSpellKnownOrOverridesKnown = IsSpellKnownOrOverridesKnown
16+
local IsSpellInSpellBook = C_SpellBook.IsSpellInSpellBook or IsSpellKnownOrOverridesKnown
17+
local IsSpellKnown = C_SpellBook.IsSpellKnown or IsPlayerSpell
1818

1919
local Retail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
2020
local Classic = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
@@ -1266,12 +1266,12 @@ do
12661266
end
12671267

12681268
local function CheckSpell(spellID, pet)
1269-
return IsSpellKnownOrOverridesKnown(spellID, pet) and true or nil
1269+
return IsSpellInSpellBook(spellID, pet, true) and true or nil
12701270
end
12711271

12721272
local function CheckPetSpells()
12731273
for spellID in next, WarlockPetSpells do
1274-
if CheckSpell(spellID, true) then
1274+
if CheckSpell(spellID, Retail and 1 or true) then
12751275
return true
12761276
end
12771277
end
@@ -1313,7 +1313,7 @@ do
13131313
elseif myClass == 'PRIEST' then
13141314
local dispel = CheckSpell(527) -- Dispel Magic
13151315
DispelList.Magic = dispel or CheckSpell(32375)
1316-
DispelList.Disease = Retail and (IsPlayerSpell(390632) or CheckSpell(213634)) or not Retail and (CheckSpell(552) or CheckSpell(528)) -- Purify Disease / Abolish Disease / Cure Disease
1316+
DispelList.Disease = Retail and (IsSpellKnown(390632) or CheckSpell(213634)) or not Retail and (CheckSpell(552) or CheckSpell(528)) -- Purify Disease / Abolish Disease / Cure Disease
13171317
elseif myClass == 'SHAMAN' then
13181318
local purify = CheckSpell(77130) -- Purify Spirit
13191319
local cleanse = purify or CheckSpell(51886) -- Cleanse Spirit (Retail/Mists)

0 commit comments

Comments
 (0)