Skip to content

Commit 876aad2

Browse files
committed
update hook for CTP updates
1 parent 84ad724 commit 876aad2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

WhatsTraining.lua

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ local function rebuildSpells(playerLevel, isLevelUpEvent)
198198
if (#category.spells > 0) then
199199
tinsert(spellsAndHeaders, category)
200200
local sortFunc =
201-
(category.key == MISSINGTALENT_KEY or category.key == IGNORED_KEY) and byNameThenLevel or byLevelThenName
201+
(category.key == MISSINGTALENT_KEY or category.key == IGNORED_KEY) and byNameThenLevel or
202+
byLevelThenName
202203
sort(category.spells, sortFunc)
203204
local totalCost = 0
204205
for _, s in ipairs(category.spells) do
@@ -456,15 +457,12 @@ end
456457

457458
local function hookCTP()
458459
wt.ctpDb = ClassTrainerPlusDBPC
459-
hooksecurefunc(
460-
"CTP_UpdateService",
461-
function()
462-
rebuildSpells(UnitLevel("player"))
463-
end
464-
)
460+
HookCTPUpdate(function()
461+
rebuildSpells(UnitLevel("player"))
462+
end)
465463
end
466464

467-
if (CTP_UpdateService) then
465+
if (HookCTPUpdate) then
468466
hookCTP()
469467
end
470468

0 commit comments

Comments
 (0)