Simplify check for whether player is dual-wielding.
Johnny C. Lam [07-07-13 - 04:43]
Simplify check for whether player is dual-wielding.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@947 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/OvaleSwing.lua b/OvaleSwing.lua
index 312012c..cc7c672 100644
--- a/OvaleSwing.lua
+++ b/OvaleSwing.lua
@@ -29,8 +29,8 @@ local OvalePaperDoll = Ovale.OvalePaperDoll
local math_abs = math.abs
local unpack = unpack
local API_GetSpellInfo = GetSpellInfo
+local API_IsDualWielding = IsDualWielding
local API_UnitAttackSpeed = UnitAttackSpeed
-local API_UnitDamage = UnitDamage
local API_UnitRangedDamage = UnitRangedDamage
local BOOKTYPE_SPELL = BOOKTYPE_SPELL
@@ -78,12 +78,7 @@ function OvaleSwing:OnDisable()
end
function OvaleSwing:PLAYER_ENTER_COMBAT()
- local _,_,offhandlow, offhandhigh = API_UnitDamage('player')
- if math_abs(offhandlow - offhandhigh) <= 0.1 or OvalePaperDoll.class == "DRUID" then
- self.dual = false
- else
- self.dual = true
- end
+ self.dual = API_IsDualWielding()
--print("Enter combat")
end