From 57c35fdcab20587912449e4f16413ab468082c8e Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sat, 12 Aug 2023 22:51:33 -0700 Subject: [PATCH] Fix warrior panic --- sim/warrior/heroic_strike_cleave.go | 8 ++++++-- sim/warrior/warrior.go | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sim/warrior/heroic_strike_cleave.go b/sim/warrior/heroic_strike_cleave.go index 28b088bd40..dbbbbbc17d 100644 --- a/sim/warrior/heroic_strike_cleave.go +++ b/sim/warrior/heroic_strike_cleave.go @@ -43,7 +43,9 @@ func (warrior *Warrior) registerHeroicStrikeSpell() *core.Spell { } spell.DealDamage(sim, result) - warrior.curQueueAura.Deactivate(sim) + if warrior.curQueueAura != nil { + warrior.curQueueAura.Deactivate(sim) + } }, }) } @@ -87,7 +89,9 @@ func (warrior *Warrior) registerCleaveSpell() *core.Spell { spell.DealDamage(sim, results[hitIndex]) curTarget = sim.Environment.NextTargetUnit(curTarget) } - warrior.curQueueAura.Deactivate(sim) + if warrior.curQueueAura != nil { + warrior.curQueueAura.Deactivate(sim) + } }, }) } diff --git a/sim/warrior/warrior.go b/sim/warrior/warrior.go index a4263f05f0..445c29f72d 100644 --- a/sim/warrior/warrior.go +++ b/sim/warrior/warrior.go @@ -145,7 +145,7 @@ func (warrior *Warrior) Initialize() { warrior.registerBloodrageCD() - if warrior.Shout != nil && warrior.PrecastShout { + if !warrior.IsUsingAPL && warrior.Shout != nil && warrior.PrecastShout { warrior.RegisterPrepullAction(-10*time.Second, func(sim *core.Simulation) { warrior.Shout.SkipCastAndApplyEffects(sim, nil) }) @@ -154,6 +154,8 @@ func (warrior *Warrior) Initialize() { func (warrior *Warrior) Reset(_ *core.Simulation) { warrior.RendValidUntil = 0 + warrior.curQueueAura = nil + warrior.curQueuedAutoSpell = nil } func NewWarrior(character core.Character, talents string, inputs WarriorInputs) *Warrior {