diff --git a/sim/core/apl.go b/sim/core/apl.go index 7ef651362e..be6608f4d4 100644 --- a/sim/core/apl.go +++ b/sim/core/apl.go @@ -162,37 +162,11 @@ func (apl *APLRotation) DoNextAction(sim *Simulation) { return } - i := 0 - - channeledDot := apl.unit.ChanneledDot - if channeledDot != nil { - if channeledDot.MaxTicksRemaining() == 0 { - // Channel has ended, but apl.unit.ChanneledDot hasn't been cleared yet meaning the aura is still active. - return - } - if apl.unit.ChanneledDot.lastTickTime != sim.CurrentTime { - // Don't allow interupts between ticks, just continue channeling until next tick. - return - } - if !apl.unit.GCD.IsReady(sim) || apl.interruptChannelIf == nil || !apl.interruptChannelIf.GetBool(sim) { - // Continue the channel. - return - } - - // Allow next action to interrupt the channel, but if the action is the same action then it still needs to continue. - nextAction := apl.getNextAction(sim) - if nextAction == nil { - return - } - if channelAction, ok := nextAction.impl.(*APLActionChannelSpell); ok && channelAction.spell == channeledDot.Spell { - // Newly selected action is channeling the same spell, so continue the channel. - return - } - channeledDot.Cancel(sim) - nextAction.Execute(sim) - i++ + if apl.unit.ChanneledDot != nil { + return } + i := 0 apl.inLoop = true for nextAction := apl.getNextAction(sim); nextAction != nil; i, nextAction = i+1, apl.getNextAction(sim) { if i > 1000 { @@ -228,6 +202,34 @@ func (apl *APLRotation) getNextAction(sim *Simulation) *APLAction { return nil } +func (apl *APLRotation) shouldInterruptChannel(sim *Simulation) bool { + channeledDot := apl.unit.ChanneledDot + if channeledDot.MaxTicksRemaining() == 0 { + // Channel has ended, but apl.unit.ChanneledDot hasn't been cleared yet meaning the aura is still active. + return false + } + if apl.unit.ChanneledDot.lastTickTime != sim.CurrentTime { + // Don't allow interupts between ticks, just continue channeling until next tick. + return false + } + if !apl.unit.GCD.IsReady(sim) || apl.interruptChannelIf == nil || !apl.interruptChannelIf.GetBool(sim) { + // Continue the channel. + return false + } + + // Allow next action to interrupt the channel, but if the action is the same action then it still needs to continue. + nextAction := apl.getNextAction(sim) + if nextAction == nil { + return false + } + if channelAction, ok := nextAction.impl.(*APLActionChannelSpell); ok && channelAction.spell == channeledDot.Spell { + // Newly selected action is channeling the same spell, so continue the channel. + return false + } + + return true +} + func APLRotationFromJsonString(jsonString string) *proto.APLRotation { apl := &proto.APLRotation{} data := []byte(jsonString) diff --git a/sim/core/dot.go b/sim/core/dot.go index 5f2ebaa7ad..f523a5d288 100644 --- a/sim/core/dot.go +++ b/sim/core/dot.go @@ -195,9 +195,9 @@ func (dot *Dot) TickOnce(sim *Simulation) { if dot.MaxTicksRemaining() == 0 { // If this was the last tick, wait 0ms to call the APL after the channel aura fully fades. dot.Spell.Unit.WaitUntil(sim, sim.CurrentTime+dot.Spell.Unit.ChannelClipDelay) - } else { - // Give the APL settings a chance to interrupt the channel. - dot.Spell.Unit.Rotation.DoNextAction(sim) + } else if dot.Spell.Unit.Rotation.shouldInterruptChannel(sim) { + dot.Cancel(sim) + dot.Spell.Unit.WaitUntil(sim, sim.CurrentTime+dot.Spell.Unit.ChannelClipDelay) } } } diff --git a/sim/priest/mind_sear.go b/sim/priest/mind_sear.go index 25ced8e7c7..c0d2857735 100644 --- a/sim/priest/mind_sear.go +++ b/sim/priest/mind_sear.go @@ -15,7 +15,7 @@ func (priest *Priest) newMindSearSpell(numTicksIdx int32) *core.Spell { numTicks := numTicksIdx flags := core.SpellFlagChanneled if numTicksIdx == 0 { - numTicks = 3 + numTicks = 5 flags |= core.SpellFlagAPL }