From f00f661545549470c8cfc52521ade46910758b7d Mon Sep 17 00:00:00 2001 From: Tharre Date: Thu, 9 Nov 2023 04:37:32 +0100 Subject: [PATCH] warlock: fix demo APL crash involving meta Since 903e2b6 majorcooldowns does not contain registered major cooldowns if they are referenced in APL, meaning `GetMajorCooldown(warlock.Metamorphosis.ActionID)` may return nil even though we have it talented. So we check for nil to avoid crashing. Fixes #3982. --- sim/warlock/rotation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/warlock/rotation.go b/sim/warlock/rotation.go index 95933e26dc..b30cef6718 100644 --- a/sim/warlock/rotation.go +++ b/sim/warlock/rotation.go @@ -83,7 +83,7 @@ func (warlock *Warlock) setupCooldowns(sim *core.Simulation) { if warlock.Talents.Metamorphosis && spell.ActionID != warlock.Metamorphosis.ActionID { metaCD := warlock.GetMajorCooldown(warlock.Metamorphosis.ActionID) - if !warlock.MetamorphosisAura.IsActive() && metaCD.TimeToNextCast(sim) < spellCD+runTime && + if !warlock.MetamorphosisAura.IsActive() && metaCD != nil && metaCD.TimeToNextCast(sim) < spellCD+runTime && retainUses(timeLeft, spellCD, metaCD.TimeToNextCast(sim)) { return false }