Skip to content

Commit

Permalink
warlock: fix demo APL crash involving meta
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Tharre committed Nov 9, 2023
1 parent a2c6c25 commit f00f661
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sim/warlock/rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f00f661

Please sign in to comment.