Skip to content

Commit

Permalink
refactor to use state.name
Browse files Browse the repository at this point in the history
  • Loading branch information
its-riece committed Jan 28, 2025
1 parent c7dffc4 commit f9c6fd5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6087,16 +6087,13 @@ Private.event_prototypes = {
test = "true",
conditionType = "bool",
conditionTest = function(state, needle)
if not state or not state.show or not UnitExists('target') then
if not state or not state.name or not state.show or not UnitExists('target') then
return false
end
if InCombatLockdown() and not UnitCanAttack('player', 'target') then
return false
end
local itemSlot = state.trigger.itemSlot
local item = GetInventoryItemID("player", itemSlot or 0)
local itemName = item and C_Item.GetItemInfo(item) or nil
return C_Item.IsItemInRange(itemName, 'target') == (needle == 1)
return C_Item.IsItemInRange(state.name, 'target') == (needle == 1)
end,
conditionEvents = AddTargetConditionEvents({
"WA_SPELL_RANGECHECK",
Expand Down

0 comments on commit f9c6fd5

Please sign in to comment.