Skip to content

Commit

Permalink
fix: #2155 - Item cooldown API was broken by Blizzard in 10.2.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Mar 22, 2024
1 parent 00a4360 commit 16dec43
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## v10.2.4
* Fix: #2154 - Errors when tracking items by slot number when the slot is empty.
* Fix: #2155 - Item cooldown API was broken by Blizzard in 10.2.6.

## v10.2.3
* Fix #2148 - Aura Tracking broken in WoW 1.15.1
Expand Down
4 changes: 2 additions & 2 deletions Components/Core/Conditions/Categories/Spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ ConditionCategory:RegisterCondition(11, "ITEMCD", {
end,
anticipate = [[
local start, duration, enable = c.Item:GetCooldown()
local VALUE = enable == 1 and duration and start + (duration - c.Level) or huge
local VALUE = (enable == 1 or enable == true) and duration and start + (duration - c.Level) or huge
]],
})
ConditionCategory:RegisterCondition(12, "ITEMCDCOMP", {
Expand All @@ -595,7 +595,7 @@ ConditionCategory:RegisterCondition(12, "ITEMCDCOMP", {
local start, duration, enable = c.Item:GetCooldown()
local start2, duration2, enable2 = c.Item2:GetCooldown()
local VALUE
if enable == 0 or enable2 == 0 then
if enable == 0 or enable == false or enable2 == 0 or enable2 == false then
VALUE = huge
elseif duration and duration2 then
local v1, v2 = start + duration, start2 + duration2
Expand Down
4 changes: 2 additions & 2 deletions Components/IconTypes/IconType_item/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ local function ItemCooldown_OnUpdate(icon, time)
start, duration, enable = item:GetCooldown()

if duration then
if enable == 0 then
if enable == 0 or enable == false then
-- Enable will be 0 for things like a potion that was used in combat
-- and the cooldown hasn't yet started counting down.
start, duration = 0, 0
Expand All @@ -146,7 +146,7 @@ local function ItemCooldown_OnUpdate(icon, time)
equipped = false
end

if equipped and inrange and enable == 1 and (duration == 0 or OnGCD(duration)) then
if equipped and inrange and (enable == 1 or enable == true) and (duration == 0 or OnGCD(duration)) then
-- This item is usable. Set the attributes and then stop.

icon:SetInfo("state; texture; start, duration; stack, stackText; spell",
Expand Down
1 change: 1 addition & 0 deletions Options/CHANGELOG.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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.
* Fix: #2155 - Item cooldown API was broken by Blizzard in 10.2.6.
## v10.2.3
* Fix #2148 - Aura Tracking broken in WoW 1.15.1
Expand Down

0 comments on commit 16dec43

Please sign in to comment.