Rather than wasting CPU on polling UnitCastingInfo every 0.5 seconds, why not use the events that fire specifically to tell you when someone in your group starts and stops casting a spell? When UNIT_SPELLCAST_START fires for a unit in your group, record the spellID in a table. During your poll, just look at the table to see which (if any) spell the unit is casting. When UNIT_SPELLCAST_SUCCEEDED/STOP/INTERRUPTED fires for a unit in your group, remove the table entry. There's no need for repeated function calls or combat log handling here.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
|