(fix/SwingTimer) Offhand in a minimal way

This commit is contained in:
NoM0Re
2025-06-08 16:41:56 +02:00
parent 7290440533
commit 5bf1397e18
+10 -7
View File
@@ -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