diff --git a/sim/core/major_cooldown.go b/sim/core/major_cooldown.go index c4396211cc..cf40f07773 100644 --- a/sim/core/major_cooldown.go +++ b/sim/core/major_cooldown.go @@ -193,11 +193,17 @@ func newMajorCooldownManager(cooldowns *proto.Cooldowns) majorCooldownManager { return majorCooldownManager{} } + cooldownConfigs := cooldownConfigs{ + HpPercentForDefensives: cooldowns.HpPercentForDefensives, + } + for _, cooldownConfig := range cooldowns.Cooldowns { + if cooldownConfig.Id != nil { + cooldownConfigs.Cooldowns = append(cooldownConfigs.Cooldowns, cooldownConfig) + } + } + return majorCooldownManager{ - cooldownConfigs: cooldownConfigs{ - Cooldowns: cooldowns.Cooldowns, - HpPercentForDefensives: cooldowns.HpPercentForDefensives, - }, + cooldownConfigs: cooldownConfigs, } } diff --git a/sim/deathknight/runespell.go b/sim/deathknight/runespell.go index 79cb0bbdf4..f944bb8147 100644 --- a/sim/deathknight/runespell.go +++ b/sim/deathknight/runespell.go @@ -24,7 +24,7 @@ type RuneSpell struct { ConvertType RuneType dk *Deathknight - CanCast RuneSpellCanCast + canCast RuneSpellCanCast onCast RuneSpellOnCast } @@ -86,15 +86,21 @@ func (rs *RuneSpell) castInternal(sim *core.Simulation, target *core.Unit) bool return result } +func (rs *RuneSpell) CanCast(sim *core.Simulation) bool { + if rs == nil { + return false + } else if rs.canCast == nil { + return true + } else { + return rs.canCast(sim) + } +} + func (rs *RuneSpell) Cast(sim *core.Simulation, target *core.Unit) bool { - if rs.CanCast == nil { + if rs.CanCast(sim) { return rs.castInternal(sim, target) - } else { - if rs.CanCast(sim) { - return rs.castInternal(sim, target) - } - return false } + return false } // RegisterSpell will connect the underlying spell to the given RuneSpell. @@ -105,7 +111,7 @@ func (dk *Deathknight) RegisterSpell(rs *RuneSpell, spellConfig core.SpellConfig rs = &RuneSpell{} } rs.dk = dk - rs.CanCast = canCast + rs.canCast = canCast rs.onCast = onCast rs.Spell = dk.Character.RegisterSpell(spellConfig) return rs diff --git a/sim/druid/talents.go b/sim/druid/talents.go index 470a8c6b0d..24107141f0 100644 --- a/sim/druid/talents.go +++ b/sim/druid/talents.go @@ -132,7 +132,7 @@ func (druid *Druid) registerNaturesSwiftnessCD() { } actionID := core.ActionID{SpellID: 17116} - spell := druid.RegisterSpell(core.SpellConfig{ + nsSpell := druid.RegisterSpell(core.SpellConfig{ ActionID: actionID, Flags: core.SpellFlagNoOnCastComplete, Cast: core.CastConfig{ @@ -157,13 +157,13 @@ func (druid *Druid) registerNaturesSwiftnessCD() { // Remove the buff and put skill on CD aura.Deactivate(sim) - spell.CD.Use(sim) + nsSpell.CD.Use(sim) druid.UpdateMajorCooldowns() }, }) druid.AddMajorCooldown(core.MajorCooldown{ - Spell: spell, + Spell: nsSpell, Type: core.CooldownTypeDPS, ShouldActivate: func(sim *core.Simulation, character *core.Character) bool { // Don't use NS unless we're casting a full-length starfire or wrath. diff --git a/sim/priest/shadow/rotation.go b/sim/priest/shadow/rotation.go index 0a827d98e7..0c37628250 100644 --- a/sim/priest/shadow/rotation.go +++ b/sim/priest/shadow/rotation.go @@ -715,7 +715,11 @@ func (spriest *ShadowPriest) tryUseGCD(sim *core.Simulation) { wait2 = core.MinDuration(dpidx, wait1) wait3 = core.MinDuration(vtidx, swpidx) wait = core.MinDuration(wait3, wait2) - spriest.WaitUntil(sim, sim.CurrentTime+wait) + if wait <= 0 { + spriest.WaitUntil(sim, sim.CurrentTime+time.Millisecond*500) + } else { + spriest.WaitUntil(sim, sim.CurrentTime+wait) + } return } if success := spell.Cast(sim, spriest.CurrentTarget); !success { diff --git a/ui/index_template.html b/ui/index_template.html index 62e6872e1a..58a6916008 100644 --- a/ui/index_template.html +++ b/ui/index_template.html @@ -33,7 +33,7 @@ - +