Skip to content

Commit

Permalink
#386 Fix Hunter threshold line Lua and error spam.
Browse files Browse the repository at this point in the history
  • Loading branch information
Twintop committed May 9, 2024
1 parent 9687586 commit 56227e4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ClassModules/Hunter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,9 @@ local function ConstructResourceBar(settings)
end
end

local thresholdId = 1
for _, v in pairs(spells) do
local spell = v --[[@as TRB.Classes.SpellBase]]
local thresholdId = 1
if (spell:Is("TRB.Classes.SpellThreshold") or spell:Is("TRB.Classes.SpellComboPointThreshold")) and spell:IsValid() then
spell = spell --[[@as TRB.Classes.SpellThreshold]]
if resourceFrame.thresholds[thresholdId] == nil then
Expand Down Expand Up @@ -1530,7 +1530,7 @@ local function UpdateResourceBar()
if (spell:Is("TRB.Classes.SpellThreshold") or spell:Is("TRB.Classes.SpellComboPointThreshold")) and spell:IsValid() then
spell = spell --[[@as TRB.Classes.SpellThreshold]]
local resourceAmount = -spell:GetPrimaryResourceCost()
TRB.Functions.Threshold:RepositionThreshold(specSettings, resourceFrame.thresholds[thresholdId], resourceFrame, -resourceAmount, TRB.Data.character.maxResource)
TRB.Functions.Threshold:RepositionThreshold(specSettings, resourceFrame.thresholds[thresholdId], resourceFrame, -resourceAmount, TRB.Data.character.maxResource, spell)

local showThreshold = true
local thresholdColor = specSettings.colors.threshold.over
Expand Down
7 changes: 7 additions & 0 deletions Functions/News.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ local content = [====[
---
# 10.2.7.4-release (2024-05-09)
## Hunter
- [#386 - FIX (Twintop)](#386) Fix threshold line creation and subsequent Lua errors and warning chat window spam.
---
# 10.2.7.3-release (2024-05-09)
## Priest
### Holy
Expand Down
1 change: 0 additions & 1 deletion Functions/Threshold.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ end

function TRB.Functions.Threshold:RepositionThreshold(settings, thresholdLine, parentFrame, resourceThreshold, resourceMax, debug)
if settings == nil or settings.bar == nil or thresholdLine == nil then
print(L["RepositionThresholdInvalid"])
return
end

Expand Down
2 changes: 1 addition & 1 deletion TwintopInsanityBar.toc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## Title-zhTW: Twintop 的資源欄
## Author: Twintop
## X-AuthorServer: Frostmourne-US/OCE
## Version: 10.2.7.3
## Version: 10.2.7.4
## X-ReleaseType: release
## X-ReleaseDate: 2024-05-09
## SavedVariables: TwintopInsanityBarSettings
Expand Down

0 comments on commit 56227e4

Please sign in to comment.