Skip to content

Commit

Permalink
Merge pull request #48 from wowsims/warrior-fix
Browse files Browse the repository at this point in the history
Core: batch OnRageChange so it is not called the same time as OnSpell…
  • Loading branch information
TheGroxEmpire authored Feb 5, 2024
2 parents b34cb8b + a1e1370 commit a4d70b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sim/core/rage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package core

import (
"fmt"
"time"

"github.com/wowsims/sod/sim/core/proto"
)
Expand Down Expand Up @@ -119,7 +120,13 @@ func (rb *rageBar) AddRage(sim *Simulation, amount float64, metrics *ResourceMet
if !sim.Options.Interactive {
rb.unit.Rotation.DoNextAction(sim)
}
rb.unit.OnRageChange(sim, metrics)
StartDelayedAction(sim, DelayedActionOptions{
DoAt: sim.CurrentTime + time.Millisecond*1,
OnAction: func(sim *Simulation) {
rb.unit.OnRageChange(sim, metrics)
},
})

}

func (rb *rageBar) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics) {
Expand Down

0 comments on commit a4d70b1

Please sign in to comment.