Skip to content

Commit 5824e94

Browse files
committed
Fix Lua error with items on action bar, fixes #276
1 parent c1ce741 commit 5824e94

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format of this changelog is based on [Keep a Changelog](https://keepachangel
1313
### Fixed
1414

1515
* Fix Moonkin form spell ID
16+
* Fix Lua error with items on action bars if automatic binding of action bar abilities is enabled {#276}
1617

1718
### Changed
1819

@@ -1756,6 +1757,7 @@ The format of this changelog is based on [Keep a Changelog](https://keepachangel
17561757
[0.4.0]: https://github.com/Snakybo/Clicked/releases/tag/0.4.0
17571758
[0.3.0]: https://github.com/Snakybo/Clicked/releases/tag/0.3.0
17581759

1760+
[#276]: https://github.com/Snakybo/Clicked/issues/276
17591761
[#270]: https://github.com/Snakybo/Clicked/issues/270
17601762
[#267]: https://github.com/Snakybo/Clicked/issues/267
17611763
[#265]: https://github.com/Snakybo/Clicked/issues/265

Clicked/Core/BindingProcessor.lua

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,22 @@ local function ConstructActions(binding, interactionType, actionBarItems)
327327

328328
-- Create virtual actions for action bar items
329329
for _, item in ipairs(actionBarItems) do
330-
if item.key == binding.keybind and (item.type == "SPELL" or item.type == "ITEM") then
331-
--- @cast item SpellLibrarySpellResult|SpellLibraryItemResult
332-
333-
table.insert(actions, {
334-
ability = C_Spell.GetSpellName(item.spellId) or C_Item.GetItemNameByID(item.itemId),
335-
type = binding.actionType
336-
})
330+
if item.key == binding.keybind then
331+
if item.type == "SPELL" then
332+
--- @cast item SpellLibrarySpellResult
333+
334+
table.insert(actions, {
335+
ability = C_Spell.GetSpellName(item.spellId),
336+
type = binding.actionType
337+
})
338+
elseif item.type == "ITEM" then
339+
--- @cast item SpellLibraryItemResult
340+
341+
table.insert(actions, {
342+
ability = C_Item.GetItemNameByID(item.itemId),
343+
type = binding.actionType
344+
})
345+
end
337346
end
338347
end
339348
end

0 commit comments

Comments
 (0)