Quantcast

Fix ticket 258 - DamageMultiplier experiences delay before updating

Johnny C. Lam [07-13-13 - 20:58]
Fix ticket 258 - DamageMultiplier experiences delay before updating

UNIT_AURA fires before stat changes take effect, so we cannot hook a
handler to update the damage multiplier onto this event.  Hook into
UNIT_DAMAGE, which fires when a unit's melee damage changes and thus
happens when/after the stat change occurs.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@967 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvalePaperDoll.lua
diff --git a/OvalePaperDoll.lua b/OvalePaperDoll.lua
index cff4c98..9bfea40 100644
--- a/OvalePaperDoll.lua
+++ b/OvalePaperDoll.lua
@@ -120,7 +120,7 @@ function OvalePaperDoll:OnEnable()
 	self:RegisterEvent("PLAYER_TALENT_UPDATE", "UpdateStats")
 	self:RegisterEvent("SPELL_POWER_CHANGED")
 	self:RegisterEvent("UNIT_ATTACK_POWER")
-	self:RegisterEvent("UNIT_AURA", "UpdateDamageMultiplier")
+	self:RegisterEvent("UNIT_DAMAGE", "UpdateDamageMultiplier")
 	self:RegisterEvent("UNIT_LEVEL")
 	self:RegisterEvent("UNIT_RANGEDDAMAGE")
 	self:RegisterEvent("UNIT_RANGED_ATTACK_POWER")
@@ -141,7 +141,7 @@ function OvalePaperDoll:OnDisable()
 	self:UnregisterEvent("PLAYER_TALENT_UPDATE")
 	self:UnregisterEvent("SPELL_POWER_CHANGED")
 	self:UnregisterEvent("UNIT_ATTACK_POWER")
-	self:UnregisterEvent("UNIT_AURA")
+	self:UnregisterEvent("UNIT_DAMAGE")
 	self:UnregisterEvent("UNIT_LEVEL")
 	self:UnregisterEvent("UNIT_RANGEDDAMAGE")
 	self:UnregisterEvent("UNIT_RANGED_ATTACK_POWER")