Skip to content

Commit 305496e

Browse files
committed
Fixed bugs with GetSpellCharges.
1 parent 3e2a757 commit 305496e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Shims.lua

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ do -- C_Spell
183183
elseif _G.GetSpellCharges then
184184
GetSpellChargesByID = _G.GetSpellCharges
185185
function SHIM:GetSpellChargesByID(spellID)
186-
return GetSpellChargesByID(spellID)
186+
return GetSpellCharges(spellID)
187187
end
188188
end
189189
end
@@ -316,16 +316,22 @@ do -- C_SpellBook
316316
-- GetSpellCharges
317317
if C_SpellBook and C_SpellBook.GetSpellBookItemCharges then
318318
GetSpellCharges = C_SpellBook.GetSpellBookItemCharges
319-
function SHIM:GetSpellCharges(index, bookType)
320-
local info = GetSpellCharges(index, bookType)
319+
function SHIM:GetSpellCharges(index, book)
320+
if book == "spell" then
321+
book = Enum.SpellBookSpellBank.Player
322+
elseif book == "pet" then
323+
book = Enum.SpellBookSpellBank.Pet
324+
end
325+
326+
local info = GetSpellCharges(index, book)
321327
if info then
322328
return info.currentCharges, info.maxCharges, info.cooldownStartTime, info.cooldownDuration, info.chargeModRate
323329
end
324330
end
325331
elseif _G.GetSpellCharges then
326332
GetSpellCharges = _G.GetSpellCharges
327-
function SHIM:GetSpellCharges(index, bookType)
328-
return GetSpellCharges(index, bookType)
333+
function SHIM:GetSpellCharges(index, book)
334+
return GetSpellCharges(index, book)
329335
end
330336
end
331337
end

0 commit comments

Comments
 (0)