[CF 1352] Counter Conditions fails if watching multiple counter values
tmw-issue-import opened this issue ยท 5 comments
I sent you some messages on curse about this a few days ago.
Counter values work fine, but if trying to have the aura succeed on multiple counter values makes the aura succeed on every counter past the first one it is set to check. For example if the counter value was checking 2/4/6, it would succeed on everything past 2.
Not sure if timer values are bugged this way.
Posted by CurseForge user Jalopyy | Imported from CurseForge issue #1352 | Raw
Do add on to this, there are additional issues.
1) If the counter is checking a combat condition, the condition will succeed on both the set value AND the value immediately after. IE, if it is set to 3, it'll ding on 3 and then briefly on 4. It does not have this kind of interaction if checking something like 'on condition passing'.
2) For both 'condition set passing' and 'combat event, a counter cannot check multiple counter values in the same aura. You'd have to make separate auras to track multiple at once.
Edited Dec 6, 2016
Posted by CurseForge user Jalopyy
Here's an example.
http://pastebin.com/mRAvHJE4 - Will succeed on 3, 4 (briefly), 5 and 6 (briefly).
It seems to be working fine for 'condition set passing' counters, actually, Possibly because before I had multiple auras with the same counter name, possibly causing the addon to mix things up?
If counter values do get messed up if multiple counters have the same name, perhaps making it so it disallows counters having the same name entirely.
Edited Dec 10, 2016
Posted by CurseForge user Jalopyy
The issue here is due to the order in which things happen when a combat event icon is triggered. The current order is as follows:
- All attributes from the event are set (start/duration time, source/dest units, the triggering spell, and the texture).
- A full icon update is performed, which evaluates any conditions on the icon and then calls the normal icon update function (which sets the icon's state - this is what governs the Opacity & Color settings).
- Any On Combat Event triggers are triggered on the icon.
Based on this process, here's what happens with this icon in particular on the 4th/6th casts if the icon was hidden when the cast happens:
- The combat event happens, setting the timer (and other stuff on the icon).
- The full icon update is performed, evaluating the condition on the icon (which is still passing because we haven't yet incremented the timer). The icon's state is updated as part of this, and because it is set to show while the timer is running, the icon shows.
- Because the icon has just shown, the sound triggers.
- The combat event notification is triggered, incrementing the counter.
- The icon's condition begins failing, causing the icon to hide.
Since this all happens in the same update cycle (no frames drawn between the start and end), you never see the icon actually show, but it does indeed show behind the scenes.
I'll make a change to the order in which things are processed, which should fix this - Combat Event triggers will now be processed before the full icon update, which will allow for any state overrides to be calculated before the icon's base state is calculated (conditions failing is a state override).
The new process for this particular icon will now look like this:
- The combat event happens, setting the timer (and other stuff on the icon).
- The combat event notification is triggered, incrementing the counter.
- The icon's condition begins failing, causing
the icon to hidenothing to happen since the icon was already hidden. However, the state override has now been set. - The full icon update is performed,
evaluating the condition on the iconand the condition won't be evaluated because nothing has changed since the previous evaluation that would prompt a reevaluation. The icon's state is updated as part of this, and because it is set to show while the timer is running, the icon's base state is set to show, but because we already set the override in step 3, the icon won't be shown and the sound won't trigger.
Edited Dec 13, 2016
Posted by CurseForge user Cybeloras