mirror of
https://github.com/parnic/LibDogTag-Unit-3.0.git
synced 2025-06-16 21:41:53 -05:00
Fix cast logic
This commit is contained in:
@ -46,7 +46,22 @@ DogTag:AddEventHandler("Unit", "EventRequested", function(_, event)
|
||||
|
||||
local spell, rank, displayName, icon, startTime, endTime
|
||||
local channeling = false
|
||||
if CastingInfo then
|
||||
if UnitCastingInfo then
|
||||
if cast_api_has_ranks then
|
||||
spell, rank, displayName, icon, startTime, endTime = UnitCastingInfo(unit)
|
||||
if not spell then
|
||||
spell, rank, displayName, icon, startTime, endTime = UnitChannelInfo(unit)
|
||||
channeling = true
|
||||
end
|
||||
else
|
||||
spell, displayName, icon, startTime, endTime = UnitCastingInfo(unit)
|
||||
rank = nil
|
||||
if not spell then
|
||||
spell, displayName, icon, startTime, endTime = UnitChannelInfo(unit)
|
||||
channeling = true
|
||||
end
|
||||
end
|
||||
elseif CastingInfo then
|
||||
-- Classic only has an API for player spellcasts. No API for arbitrary units.
|
||||
if unit == "player" then
|
||||
spell, displayName, icon, startTime, endTime = CastingInfo()
|
||||
@ -56,19 +71,6 @@ DogTag:AddEventHandler("Unit", "EventRequested", function(_, event)
|
||||
channeling = true
|
||||
end
|
||||
end
|
||||
elseif cast_api_has_ranks then
|
||||
spell, rank, displayName, icon, startTime, endTime = UnitCastingInfo(unit)
|
||||
if not spell then
|
||||
spell, rank, displayName, icon, startTime, endTime = UnitChannelInfo(unit)
|
||||
channeling = true
|
||||
end
|
||||
else
|
||||
spell, displayName, icon, startTime, endTime = UnitCastingInfo(unit)
|
||||
rank = nil
|
||||
if not spell then
|
||||
spell, displayName, icon, startTime, endTime = UnitChannelInfo(unit)
|
||||
channeling = true
|
||||
end
|
||||
end
|
||||
|
||||
if spell then
|
||||
|
Reference in New Issue
Block a user