Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 2b373f7

Browse files
committed
fixes #298
1 parent 2d4355d commit 2b373f7

File tree

1 file changed

+5
-30
lines changed

1 file changed

+5
-30
lines changed

Objects/STATUSBTN.lua

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,8 @@ end
802802

803803
function STATUSBTN:CastBar_OnEvent(event, ...)
804804

805-
local unit = ...
805+
local unit = select(1, ...)
806+
local eventCastID = select(2,...)--return payload is "unitTarget", "castGUID", spellID
806807

807808
if (unit ~= self.sb.unit) then
808809
return
@@ -876,39 +877,13 @@ function STATUSBTN:CastBar_OnEvent(event, ...)
876877
self.sb.cbtimer.castInfo[unit][1] = text
877878
self.sb.cbtimer.castInfo[unit][2] = "%0.1f"
878879

879-
elseif (event == "UNIT_SPELLCAST_SUCCEEDED" and not self.sb.channeling) then
880+
elseif (event == "UNIT_SPELLCAST_SUCCEEDED" and not self.sb.channeling) then --don't do anything with this event when channeling as it fires at each pulse of a spell channel
880881

881882
self.sb:SetStatusBarColor(self.sb.successColor[1], self.sb.successColor[2], self.sb.successColor[3], self.sb.successColor[4])
882883

883-
elseif (event == "UNIT_SPELLCAST_SUCCEEDED" and self.sb.channeling) then
884+
elseif (event == "UNIT_SPELLCAST_FAILED" or event == "UNIT_SPELLCAST_INTERRUPTED" or event == "UNIT_SPELLCAST_STOP" or event == "UNIT_SPELLCAST_CHANNEL_STOP") and self.sb.castID == eventCastID then
884885

885-
-- do nothing (when Tranquility is channeling if reports UNIT_SPELLCAST_SUCCEEDED many times during the duration)
886-
887-
elseif (event == "UNIT_SPELLCAST_STOP" or event == "UNIT_SPELLCAST_CHANNEL_STOP") then
888-
889-
if ((self.sb.casting and event == "UNIT_SPELLCAST_STOP") or
890-
(self.sb.channeling and event == "UNIT_SPELLCAST_CHANNEL_STOP")) then
891-
892-
self.sb.spark:Hide()
893-
self.sb.barflash:SetAlpha(0.0)
894-
self.sb.barflash:Show()
895-
896-
self.sb:SetValue(self.sb.maxValue)
897-
898-
if (event == "UNIT_SPELLCAST_STOP") then
899-
self.sb.casting = false
900-
else
901-
self.sb.channeling = false
902-
end
903-
904-
self.sb.flash = 1
905-
self.sb.fadeOut = 1
906-
self.sb.holdTime = 0
907-
end
908-
909-
elseif (event == "UNIT_SPELLCAST_FAILED" or event == "UNIT_SPELLCAST_INTERRUPTED") then
910-
911-
if (self.sb:IsShown() and (self.sb.casting) and not self.sb.fadeOut) then
886+
if (self.sb:IsShown() and ((self.sb.casting) or self.sb.channeling) and not self.sb.fadeOut) then
912887

913888
self.sb:SetValue(self.sb.maxValue)
914889

0 commit comments

Comments
 (0)