Skip to content

Commit

Permalink
Merge pull request #4177 from wowsims/apl
Browse files Browse the repository at this point in the history
Fix rare panic when swapping items
  • Loading branch information
jimmyt857 authored Jan 15, 2024
2 parents e1c1136 + d6edeb9 commit 4b04acc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sim/core/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,11 @@ func (wa *WeaponAttack) swing(sim *Simulation) time.Duration {
// Need to check APL here to allow last-moment HS queue casts.
wa.unit.Rotation.DoNextAction(sim)

// Allow MH swing to be overridden for abilities like Heroic Strike.
attackSpell = wa.replaceSwing(sim, attackSpell)
// Need to check this again in case the DoNextAction call swapped items.
if wa.replaceSwing != nil {
// Allow MH swing to be overridden for abilities like Heroic Strike.
attackSpell = wa.replaceSwing(sim, attackSpell)
}
}

// Update swing timer BEFORE the cast, so that APL checks for TimeToNextAuto behave correctly
Expand Down

0 comments on commit 4b04acc

Please sign in to comment.