From 5bf1397e18a9c0a4d9939fccf87ba090f6baa163 Mon Sep 17 00:00:00 2001 From: NoM0Re <1629787+NoM0Re@users.noreply.github.com> Date: Sun, 8 Jun 2025 16:41:56 +0200 Subject: [PATCH] (fix/SwingTimer) Offhand in a minimal way --- WeakAuras/GenericTrigger.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index ac62de8..048d309 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -1986,10 +1986,10 @@ do swingTriggerUpdate() end - local function swingStart(hand) + local function swingStart(hand, curTime) mainSpeed, offSpeed = UnitAttackSpeed("player") offSpeed = offSpeed or 0 - local currentTime = GetTime() + local currentTime = curTime or GetTime() if hand == "main" then lastSwingMain = currentTime swingDurationMain = mainSpeed @@ -2041,12 +2041,15 @@ do return end end - local isOffHand = select(event == "SWING_DAMAGE" and 10 or 2, ...); - if not isOffHand then - swingStart("main") - elseif(isOffHand) then - swingStart("off") + + local currentTime = GetTime() + local hand = "main" + if offSpeed and offSpeed > 0 and lastSwingMain then + if (currentTime - lastSwingMain) < (mainSpeed * 0.6) then + hand = "off" + end end + swingStart(hand, currentTime) swingTriggerUpdate() end elseif (destGUID == selfGUID and (... == "PARRY" or select(4, ...) == "PARRY")) then