Skip to content

Commit

Permalink
Fix item detection at first login (was causing Use Items to fire for …
Browse files Browse the repository at this point in the history
…all items until a /reload).
  • Loading branch information
Hekili committed Feb 6, 2020
1 parent c4a5c45 commit 41dc571
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
27 changes: 13 additions & 14 deletions Classes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -595,19 +595,17 @@ local HekiliSpecMixin = {
end
end

if not a.item then
self.abilities[ ability ] = a
self.abilities[ a.id ] = a

if not a.unlisted then class.abilityList[ ability ] = class.abilityList[ ability ] or a.listName or a.name end

if data.copy then
if type( data.copy ) == 'string' or type( data.copy ) == 'number' then
self.abilities[ data.copy ] = a
elseif type( data.copy ) == 'table' then
for _, key in ipairs( data.copy ) do
self.abilities[ key ] = a
end
self.abilities[ ability ] = a
self.abilities[ a.id ] = a

if not a.unlisted then class.abilityList[ ability ] = class.abilityList[ ability ] or a.listName or a.name end

if data.copy then
if type( data.copy ) == 'string' or type( data.copy ) == 'number' then
self.abilities[ data.copy ] = a
elseif type( data.copy ) == 'table' then
for _, key in ipairs( data.copy ) do
self.abilities[ key ] = a
end
end
end
Expand Down Expand Up @@ -5050,10 +5048,11 @@ function Hekili:SpecializationChanged()
ns.callHook( 'specializationChanged' )

ns.updateTalents()
-- ns.updateGear()

self:UpdateDisplayVisibility()

self:RefreshOptions()
self:RefreshOptions()
self:LoadScripts()
end

Expand Down
2 changes: 1 addition & 1 deletion Events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ do
local lastEssence = class.active_essence
ns.updateEssences()

local sameItems = #wasWearing == #state.items
local sameItems = true

if sameItems then
for i = 1, #state.items do
Expand Down
2 changes: 1 addition & 1 deletion Scripts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ function scripts:LoadScripts()
local ability

if data.action then
ability = specData.abilities[ data.action ] or class.specs[0].abilities[ data.action ]
ability = specData.abilities[ data.action ] or class.abilities[ data.action ]
end

if ability then
Expand Down

0 comments on commit 41dc571

Please sign in to comment.