[Bug] Swing Timer - condition updates not often enough
Sqoops opened this issue ยท 1 comments
The "Swing Timer - Main Hand" and "Swing Timer - Off Hand" conditions do not update often enough.
I want my TMW icon to only show up if my main hand swing timer has only 1 second left before the next swing will land. Instead the icon will never show up.
The condition is found here:
\TellMeWhen\Components\Core\Conditions\Categories\Spells.lua
ConditionCategory:RegisterCondition(19, "MHSWING", {
And its programmed to update on "TMW_COMMON_SWINGTIMER_CHANGED"
However "TMW_COMMON_SWINGTIMER_CHANGED" only gets fired once per swing.
changing
events = function(ConditionObject, c)
ConditionObject:RequestEvent("TMW_COMMON_SWINGTIMER_CHANGED")
ConditionObject:SetNumEventArgs(1)
return
"event == 'TMW_COMMON_SWINGTIMER_CHANGED' and arg1.slot == " .. GetInventorySlotInfo("MainHandSlot")
end,
into
events = function(ConditionObject, c)
ConditionObject:RequestEvent("COMBAT_LOG_EVENT_UNFILTERED")
return
"event == 'COMBAT_LOG_EVENT_UNFILTERED' "
end,
makes the condition check more often if the timer has changed and will actually show my created icon. Its not the best fix though as it relies on the combat_log - so if nothing else happens the condition wont update. Can your create an event that fires every 100ms to properly fix this?
Thanks for the report. The issue is that the anticipate function was just completely wrong - I probably copy-pasted it from somewhere else and made minimal changes to make it seem right for swing timers without actually testing it.
The anticipate function is what determines at what time an update is needed based on the configured duration.