Skip to content

Commit

Permalink
Fix another bug with strict sequences and disable noisy logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyt857 committed Aug 9, 2023
1 parent b484630 commit 226d48f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions sim/core/apl.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ func (apl *APLRotation) getNextAction(sim *Simulation) *APLAction {
}

for _, action := range apl.priorityList {
if _, ok := action.impl.(*APLActionStrictSequence); ok {
apl.strictSequence = action
}
if action.IsReady(sim) {
if _, ok := action.impl.(*APLActionStrictSequence); ok {
apl.strictSequence = action
}
return action
}
}
Expand Down
30 changes: 15 additions & 15 deletions sim/core/spell.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,41 +428,41 @@ func (spell *Spell) CanCast(sim *Simulation, target *Unit) bool {
}

if spell.ExtraCastCondition != nil && !spell.ExtraCastCondition(sim, target) {
if sim.Log != nil {
sim.Log("Cant cast because of extra condition")
}
//if sim.Log != nil {
// sim.Log("Cant cast because of extra condition")
//}
return false
}

// While casting or channeling, no other action is possible
if spell.Unit.Hardcast.Expires > sim.CurrentTime {
if sim.Log != nil {
sim.Log("Cant cast because already casting/channeling")
}
//if sim.Log != nil {
// sim.Log("Cant cast because already casting/channeling")
//}
return false
}

if spell.DefaultCast.GCD > 0 && !spell.Unit.GCD.IsReady(sim) {
if sim.Log != nil {
sim.Log("Cant cast because of GCD")
}
//if sim.Log != nil {
// sim.Log("Cant cast because of GCD")
//}
return false
}

if !BothTimersReady(spell.CD.Timer, spell.SharedCD.Timer, sim) {
if sim.Log != nil {
sim.Log("Cant cast because of CDs")
}
//if sim.Log != nil {
// sim.Log("Cant cast because of CDs")
//}
return false
}

if spell.Cost != nil {
// temp hack
spell.CurCast.Cost = spell.DefaultCast.Cost
if !spell.Cost.MeetsRequirement(spell) {
if sim.Log != nil {
sim.Log("Cant cast because of resource cost")
}
//if sim.Log != nil {
// sim.Log("Cant cast because of resource cost")
//}
return false
}
}
Expand Down

0 comments on commit 226d48f

Please sign in to comment.