From a1e13703c2184ed3c2a77a3e65303e665cd71437 Mon Sep 17 00:00:00 2001 From: The Grox Empire <47816228+TheGroxEmpire@users.noreply.github.com> Date: Mon, 5 Feb 2024 07:56:18 +0700 Subject: [PATCH] Core: batch OnRageChange so it is not called the same time as OnSpellHitDealt --- sim/core/rage.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sim/core/rage.go b/sim/core/rage.go index 5bb21e2799..dea799e530 100644 --- a/sim/core/rage.go +++ b/sim/core/rage.go @@ -2,6 +2,7 @@ package core import ( "fmt" + "time" "github.com/wowsims/sod/sim/core/proto" ) @@ -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) {