From 67ca2fb881b4a9b621956a1d45ef6c9a559d59df Mon Sep 17 00:00:00 2001 From: Tharre Date: Thu, 9 Nov 2023 04:57:26 +0100 Subject: [PATCH] warlock: fix crash when casting DS without haunt talented Fixes #3992, #3999. --- sim/warlock/apl_values.go | 9 ++++++--- sim/warlock/drain_soul.go | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sim/warlock/apl_values.go b/sim/warlock/apl_values.go index 7dfe8f0c36..5db91673eb 100644 --- a/sim/warlock/apl_values.go +++ b/sim/warlock/apl_values.go @@ -50,9 +50,12 @@ func (value *APLValueWarlockShouldRecastDrainSoul) GetBool(sim *core.Simulation) warlock.CurseOfWeaknessAuras.Get(warlock.CurrentTarget).RemainingDuration(sim), ) - warlock.CurseOfAgony.CastTime() - hauntRefresh := warlock.HauntDebuffAuras.Get(warlock.CurrentTarget).RemainingDuration(sim) - - warlock.Haunt.CastTime() - - warlock.Haunt.TravelTime() + hauntRefresh := 1000 * time.Second + if warlock.HauntDebuffAuras != nil { + hauntRefresh = warlock.HauntDebuffAuras.Get(warlock.CurrentTarget).RemainingDuration(sim) - + warlock.Haunt.CastTime() - + warlock.Haunt.TravelTime() + } timeUntilRefresh := min(uaRefresh, curseRefresh) diff --git a/sim/warlock/drain_soul.go b/sim/warlock/drain_soul.go index d7f2fcbdf3..1d6dc28610 100644 --- a/sim/warlock/drain_soul.go +++ b/sim/warlock/drain_soul.go @@ -11,7 +11,6 @@ func (warlock *Warlock) registerDrainSoulSpell() { calcSoulSiphonMult := func(target *core.Unit) float64 { auras := []*core.Aura{ - warlock.HauntDebuffAuras.Get(target), warlock.UnstableAffliction.Dot(target).Aura, warlock.Corruption.Dot(target).Aura, warlock.Seed.Dot(target).Aura, @@ -23,6 +22,9 @@ func (warlock *Warlock) registerDrainSoulSpell() { warlock.ShadowEmbraceDebuffAura(target), // missing: death coil } + if warlock.HauntDebuffAuras != nil { + auras = append(auras, warlock.HauntDebuffAuras.Get(target)) + } numActive := 0 for _, aura := range auras { if aura.IsActive() {