That's not really a hack, though it is a bit inefficient. You really only need to keep track of the unique ID for the cast. Assuming that the relevant UNIT_SPELLCAST_INTERRUPTED event always fires after the UNIT_SPELLCAST_SUCCEEDED event for your Pummel, something like this is fairly straightforward and should get the job done:
Code:
local pummelCast
local f = CreateFrame("Frame")
f:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player")
f:RegisterUnitEvent("UNIT_SPELLCAST_INTERRUPTED", "target")
f:SetScript("OnEvent", function(self, event, ...)
if event == "UNIT_SPELLCAST_SUCCEEDED" then
-- You cast Pummel
local _, _, _, _, _, _, _, castID, interruptible = UnitCastingInfo("target")
if castID and interruptible then
pummelCast = castID
else
castID = nil
end
else
-- Your target's spellcast was interrupted
local _, _, _, castID, spellID = ...
if castID = pummelCast then
print("Interrupted", GetSpellLink(spellID))
end
knownCastID = nil
end
end)
If you're using Pummel on units other than your target, you'll need to make some minor modifications to avoid using a hardcoded "target" unit, but you don't need to keep track of the target between events, because two units won't ever share a castID.