Skip to content

Commit

Permalink
Remove extraneous calls to WaitForMana()
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyt857 committed Jan 21, 2024
1 parent d8584e9 commit d5f0012
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
8 changes: 2 additions & 6 deletions sim/hunter/explosive_trap.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,9 @@ func (hunter *Hunter) registerExplosiveTrapSpell(timer *core.Timer) {
hunter.AutoAttacks.DelayRangedUntil(sim, doneAt+time.Millisecond*500)

if layTrapAt == sim.CurrentTime {
success := hunter.ExplosiveTrap.Cast(sim, target)
hunter.ExplosiveTrap.Cast(sim, target)
if doneAt > hunter.GCD.ReadyAt() {
hunter.GCD.Set(doneAt)
} else if !success {
hunter.WaitForMana(sim, hunter.ExplosiveTrap.CurCast.Cost)
}
} else {
// Make sure the GCD doesn't get used while we're waiting.
Expand All @@ -127,11 +125,9 @@ func (hunter *Hunter) registerExplosiveTrapSpell(timer *core.Timer) {
DoAt: layTrapAt,
OnAction: func(sim *core.Simulation) {
hunter.GCD.Reset()
success := hunter.ExplosiveTrap.Cast(sim, target)
hunter.ExplosiveTrap.Cast(sim, target)
if doneAt > hunter.GCD.ReadyAt() {
hunter.GCD.Set(doneAt)
} else if !success {
hunter.WaitForMana(sim, hunter.ExplosiveTrap.CurCast.Cost)
}
},
})
Expand Down
4 changes: 1 addition & 3 deletions sim/mage/water_elemental.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ func (we *WaterElemental) ExecuteCustomRotation(sim *core.Simulation) {
return
}

if success := spell.Cast(sim, we.CurrentTarget); !success {
we.WaitForMana(sim, spell.CurCast.Cost)
}
spell.Cast(sim, we.CurrentTarget)
}

// These numbers are just rough guesses based on looking at some logs.
Expand Down
1 change: 0 additions & 1 deletion sim/shaman/fire_elemental_pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func (fireElemental *FireElemental) ExecuteCustomRotation(sim *core.Simulation)
}

if fireElemental.FireNova.DefaultCast.Cost > fireElemental.CurrentMana() {
fireElemental.WaitForMana(sim, fireElemental.FireNova.DefaultCast.Cost)
return
}

Expand Down
4 changes: 1 addition & 3 deletions sim/warlock/pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,7 @@ func (wp *WarlockPet) ExecuteCustomRotation(sim *core.Simulation) {
return
}

if success := wp.primaryAbility.Cast(sim, wp.CurrentTarget); !success {
wp.WaitForMana(sim, wp.primaryAbility.CurCast.Cost)
}
wp.primaryAbility.Cast(sim, wp.CurrentTarget)
}

func (warlock *Warlock) makeStatInheritance() core.PetStatInheritance {
Expand Down

0 comments on commit d5f0012

Please sign in to comment.