Skip to content

Commit

Permalink
fix: #2154 Errors when tracking items by slot number when the slot is…
Browse files Browse the repository at this point in the history
… empty.
  • Loading branch information
ascott18 committed Mar 20, 2024
1 parent f210865 commit 00a4360
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v10.2.4
* Fix: #2154 - Errors when tracking items by slot number when the slot is empty.

## v10.2.3
* Fix #2148 - Aura Tracking broken in WoW 1.15.1

Expand Down
15 changes: 12 additions & 3 deletions Components/Core/Common/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ function Item:GetCooldown()
error("This function must be overridden by subclasses")
end
function Item:HasUseEffect()
return not not GetItemSpell(self:GetID())
local id = self:GetID()
if not id then return false end
return not not GetItemSpell(id)
end
function Item:GetID()
error("This function must be overridden by subclasses")
Expand Down Expand Up @@ -182,6 +184,9 @@ end
function Item.NullRef:GetCooldown()
return 0, 0, 0
end
function Item.NullRef:HasUseEffect()
return false
end
function Item.NullRef:GetID()
return 0
end
Expand Down Expand Up @@ -349,7 +354,9 @@ end


function ItemBySlot:IsInRange(unit)
return IsItemInRange(self:GetLink(), unit)
local link = self:GetLink()
if not link then return false end
return IsItemInRange(link, unit)
end
function ItemBySlot:GetIcon()
return GetInventoryItemTexture("player", self.slot)
Expand All @@ -358,7 +365,9 @@ function ItemBySlot:GetCount()
return ItemCount[self:GetID()]
end
function ItemBySlot:GetEquipped()
return IsEquippedItem(self:GetLink())
local link = self:GetLink()
if not link then return false end
return IsEquippedItem(link)
end
function ItemBySlot:GetCooldown()
return GetInventoryItemCooldown("player", self.slot)
Expand Down
3 changes: 3 additions & 0 deletions Options/CHANGELOG.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ if not TMW then return end
TMW.CHANGELOG_LASTVER="7.4.0"

TMW.CHANGELOG = [==[
## v10.2.4
* Fix: #2154 - Errors when tracking items by slot number when the slot is empty.
## v10.2.3
* Fix #2148 - Aura Tracking broken in WoW 1.15.1
Expand Down
2 changes: 1 addition & 1 deletion TellMeWhen-Classic.toc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
## X-WoWI-ID: 10855
## X-Wago-ID: ZQ6aZqKW

## Version: 10.2.3
## Version: 10.2.4
## Author: Cybeloras of Aerie Peak
## IconTexture: Interface\Addons\TellMeWhen\Textures\LDB Icon
## AddonCompartmentFunc: TellMeWhen_OnAddonCompartmentClick
Expand Down
2 changes: 1 addition & 1 deletion TellMeWhen-Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
## X-WoWI-ID: 10855
## X-Wago-ID: ZQ6aZqKW

## Version: 10.2.3
## Version: 10.2.4
## Author: Cybeloras of Aerie Peak
## IconTexture: Interface\Addons\TellMeWhen\Textures\LDB Icon
## AddonCompartmentFunc: TellMeWhen_OnAddonCompartmentClick
Expand Down
2 changes: 1 addition & 1 deletion TellMeWhen.toc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
## X-WoWI-ID: 10855
## X-Wago-ID: ZQ6aZqKW

## Version: 10.2.3
## Version: 10.2.4
## Author: Cybeloras of Aerie Peak
## IconTexture: Interface\Addons\TellMeWhen\Textures\LDB Icon
## AddonCompartmentFunc: TellMeWhen_OnAddonCompartmentClick
Expand Down

0 comments on commit 00a4360

Please sign in to comment.