Skip to content

Commit

Permalink
warlock: fix crash when casting DS without haunt talented
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharre committed Nov 9, 2023
1 parent f00f661 commit 67ca2fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions sim/warlock/apl_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion sim/warlock/drain_soul.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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() {
Expand Down

0 comments on commit 67ca2fb

Please sign in to comment.