Bunny67 / WeakAuras-WotLK

World of Warcraft addon that provides a powerful framework to display customizable graphics on your screen.
GNU General Public License v2.0
161 stars 105 forks source link

Fixes for SwingTimer as suggested by Cheeta #77

Closed LundmarkJ closed 1 year ago

LundmarkJ commented 3 years ago

As suggested on discord in the #wa-support channel. The code for handling Swing Timers have issues which are address as followed by Cheeta's suggestions by the post (https://discord.com/channels/259362419372064778/740945052989128724/855632779035410432):

04:19] Cheeta: I have already tried a few SwingTimer for MH and OH and the one from the current WA version was by far the best (reacts to attack speed changes like Flurry talent). By the way, cant recommend the one from Elvui at all. However, there are still a few bugs in the code that I had changed myself (no idea about Github or how to make a pull request there). If you are interested you can try to reproduce these changes and test again:

GenericTrigger.lua: Typo in line 1518: (mostly it should solve the problem that the MH swingtimer randomly disappears ) timer:CancelTimer(mainTimer, true); to timer:CancelTimer(offTimer, true);

calculate more accurate duration after attack speed changes in line 1557: swingDurationMain = mainSpeedNew to swingDurationMain = GetTime()-lastSwingMain + timeLeft

and line 1567: swingDurationOff = offSpeedNew to swingDurationOff = GetTime() - lastSwingOff + timeLeft

And last a Typo again in line 1565: local multiplier = offSpeedNew / mainSpeed change to local multiplier = offSpeedNew / offSpeed

Due to their unfamiliarity with Git I've made the pull request for them.