From 8b5a68609a85f19e9e93714dda1b29052585801d Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sun, 17 Mar 2013 08:05:30 +0000 Subject: [PATCH] Fix the event handler for Ovale_InactiveUnit in OvaleAura. Event handlers are passed the event as the first argument. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@789 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleAura.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OvaleAura.lua b/OvaleAura.lua index cce0910..61ce1c5 100644 --- a/OvaleAura.lua +++ b/OvaleAura.lua @@ -88,6 +88,7 @@ end function RemoveAurasForGUID(guid) -- Return all auras for the given GUID to the aura pool. if not guid or not OvaleAura_aura[guid] then return end + Ovale:DebugPrint("aura", "Removing auras for guid " .. guid) for spellId, whoseTable in pairs(OvaleAura_aura[guid]) do for whose, aura in pairs(whoseTable) do whoseTable[whose] = nil @@ -121,7 +122,7 @@ function OvaleAura:OnEnable() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("UNIT_AURA") self:RegisterMessage("Ovale_GroupChanged", RemoveAurasForMissingUnits) - self:RegisterMessage("Ovale_InactiveUnit", RemoveAurasForGUID) + self:RegisterMessage("Ovale_InactiveUnit") end function OvaleAura:OnDisable() @@ -169,6 +170,10 @@ function OvaleAura:UNIT_AURA(event, unitId) end end +function OvaleAura:Ovale_InactiveUnit(event, guid) + RemoveAurasForGUID(guid) +end + function OvaleAura:UpdateAuras(unitId, unitGUID) OvaleAura_serial = OvaleAura_serial + 1 @@ -232,7 +237,7 @@ function OvaleAura:UpdateAuras(unitId, unitGUID) for spellId,whoseTable in pairs(auraList) do for whose,aura in pairs(whoseTable) do if aura.serial ~= OvaleAura_serial then - Ovale:DebugPrint("aura", "Removing "..aura.name.." from "..whose .. " OvaleAura_serial = " ..OvaleAura_serial .. " aura.serial = " ..aura.serial) + Ovale:DebugPrint("aura", "Removing "..aura.name.." from "..whose .. ", serial = " ..OvaleAura_serial.. " aura.serial = " ..aura.serial) whoseTable[whose] = nil auraPool:Release(aura) end -- 1.7.9.5