Closed Wyste closed 2 years ago
Spend hooks are for virtual/emulated behavior, not real spend. I.e., it fires when the addon recommends an ability and needs to spend resources before generating the next recommendation.
For reference, compare the spend hook here: https://github.com/Hekili/hekili/blob/dragonflight/Classes/WarriorArms.lua#L331
To the UNIT_POWER_FREQUENT handler here: https://github.com/Hekili/hekili/blob/dragonflight/Classes/WarriorArms.lua#L369
The spend hook is what the addon does virtually when it is generating multiple recommendations in one moment (i.e., use Bladestorm then Mortal Strike then whatever).
The UNIT_POWER_FREQUENT handler is where real expenditures are caught. Actual Rage expenditures are counted here (https://github.com/Hekili/hekili/blob/dragonflight/Classes/WarriorArms.lua#L323) in the rageSpent
variable, while the "state" environment creates rage_spent
for the same data. rage_spent
defaults to rageSpent
, but can be updated moving step to step and then reset again (https://github.com/Hekili/hekili/blob/dragonflight/Classes/WarriorArms.lua#L398) for the next set of recommendations.
One of the most challenging things to keep track of, when coding for the addon, is keeping track of what is "real" vs. what is a projection out into the future.
Before You Begin
Describe the Issue
"spend" hooks within class files fire irregularly.
I've detailed more for Protection warrior in the How to Reproduce section, but I have also tested Warlock(Destruction) and found the spend hook fires when OOC and flying on a mount as well.
Destro Warlock (ooc - flying around):
Protection Warrior, very quick combat (some melee, 2 abilities used and then the mob was dead:
How to Reproduce
(Using v9.2.7-1.0.0b release freshly installed except the following changes:)
In my case for Prot Warrior: During a fight, just after a fight, during rage decay, or even when at 0 rage flying around with 0 interaction with anything, have seen the spend hook fire for a multitude of reasons.
Note FYI for the below pictures - "charge" was the recommended action here, which would net me +20 rage. (code used to reproduce)
Snapshot (Link)
https://pastebin.com/pctDU9U6
Raidbots Sim Report (Link)
No response
Additional Information
No response
Contact Information
Wyste#8631