Commit 51c4779a authored by Simpy's avatar Simpy 🐹
Browse files

reduce calls to `UnitChannelInfo` when unneeded on nameplate castbars which is called often

parent 2ca103a0
......@@ -68,15 +68,20 @@ function mod:UpdateElement_Cast(frame, event, ...)
local arg1, arg2 = ...;
local unit = frame.displayedUnit
if ( event == "PLAYER_ENTERING_WORLD" ) then
local nameChannel = UnitChannelInfo(unit);
if ( event == "PLAYER_ENTERING_WORLD" ) then -- this event is often fake
local nameSpell = UnitCastingInfo(unit);
if ( nameChannel ) then
event = "UNIT_SPELLCAST_CHANNEL_START";
arg1 = unit;
elseif ( nameSpell ) then
local nameChannel
if not nameSpell then
nameChannel = UnitChannelInfo(unit);
end
if nameSpell then
event = "UNIT_SPELLCAST_START";
arg1 = unit;
elseif nameChannel then
event = "UNIT_SPELLCAST_CHANNEL_START";
arg1 = unit;
else
frame.CastBar:Hide()
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment