@@ -25,6 +25,7 @@ local GetNamePlateForUnit = _G.C_NamePlate.GetNamePlateForUnit
25
25
local UnitIsFriend = _G .UnitIsFriend
26
26
local UnitCastingInfo = _G .UnitCastingInfo
27
27
local UnitChannelInfo = _G .UnitChannelInfo
28
+ local CastingInfo = _G .CastingInfo
28
29
local UnitIsUnit = _G .UnitIsUnit
29
30
local gsub = _G .string .gsub
30
31
local strsplit = _G .string .split
@@ -119,7 +120,11 @@ function ClassicCastbars:BindCurrentCastData(castbar, unitID, isChanneled, chann
119
120
if not isChanneled then
120
121
spellName , _ , iconTexturePath , startTimeMS , endTimeMS , _ , castID , notInterruptible , spellID = UnitCastingInfo (unitID )
121
122
else
122
- spellName , _ , iconTexturePath , startTimeMS , endTimeMS , _ , notInterruptible , spellID = UnitChannelInfo (unitID )
123
+ if CastingInfo and UnitIsUnit (" player" , unitID ) then
124
+ spellName , _ , iconTexturePath , startTimeMS , endTimeMS , _ , notInterruptible , spellID = UnitChannelInfo (" player" ) -- UnitChannelInfo is bugged for classic era, tmp fallback method
125
+ else
126
+ spellName , _ , iconTexturePath , startTimeMS , endTimeMS , _ , notInterruptible , spellID = UnitChannelInfo (unitID )
127
+ end
123
128
if channelSpellID and not spellName then -- UnitChannelInfo is bugged for classic era, tmp fallback method
124
129
spellName , _ , iconTexturePath = GetSpellInfo (channelSpellID )
125
130
local channelCastTime = spellName and channeledSpells [spellName ]
@@ -273,6 +278,10 @@ function ClassicCastbars:PLAYER_TARGET_CHANGED() -- when you change your own tar
273
278
elseif UnitChannelInfo (" target" ) then
274
279
self :UNIT_SPELLCAST_CHANNEL_START (" target" )
275
280
end
281
+
282
+ if UnitIsUnit (" player" , " target" ) and UnitChannelInfo (" player" ) then -- UnitChannelInfo is bugged, tmp fallback method for when player is target
283
+ self :UNIT_SPELLCAST_CHANNEL_START (" target" )
284
+ end
276
285
end
277
286
278
287
function ClassicCastbars :PLAYER_FOCUS_CHANGED ()
0 commit comments