Skip to content

Commit

Permalink
Fix IsAddOnEnabled
Browse files Browse the repository at this point in the history
The loadable state is not accurate when dealing with multiple characters
  • Loading branch information
p3lim committed Nov 28, 2024
1 parent 9576d49 commit 37ab14e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/load.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ local _, addon = ...
Checks whether the addon exists and is enabled.
--]]
function addon:IsAddOnEnabled(name)
local _, _, _, loadable = C_AddOns.GetAddOnInfo(name)
return not not loadable -- will be false if the addon is missing or disabled
return C_AddOns.GetAddOnEnableState(name, UnitName('player')) > 0

Check warning on line 7 in modules/load.lua

View workflow job for this annotation

GitHub Actions / lint

accessing undefined variable 'UnitName'
end


Expand Down

0 comments on commit 37ab14e

Please sign in to comment.