Skip to content

Commit

Permalink
Update bone_shield.go
Browse files Browse the repository at this point in the history
Bone shield was being consumed with every enemy attack, regardless of it hitting or not. Added a check to see if the attack actually landed before running the stack removal logic.
  • Loading branch information
DominicJamesWhite authored May 20, 2023
1 parent 42502d2 commit c9e5a22
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sim/deathknight/bone_shield.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ func (dk *Deathknight) registerBoneShieldSpell() {
dk.BoneShieldAura.SetStacks(sim, dk.BoneShieldAura.MaxStacks)
},
OnSpellHitTaken: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if sim.CurrentTime > stackRemovalCd+2*time.Second {
stackRemovalCd = sim.CurrentTime
if result.Landed() {
if sim.CurrentTime > stackRemovalCd+2*time.Second {
stackRemovalCd = sim.CurrentTime

aura.RemoveStack(sim)
if aura.GetStacks() == 0 {
aura.Deactivate(sim)
aura.RemoveStack(sim)
if aura.GetStacks() == 0 {
aura.Deactivate(sim)
}
}
}
},
Expand Down

0 comments on commit c9e5a22

Please sign in to comment.