Skip to content

Commit

Permalink
Inline new function since its only used once
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyt857 committed Jan 6, 2024
1 parent ba69e78 commit cfececa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
7 changes: 6 additions & 1 deletion sim/core/apl_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ func (rot *APLRotation) GetAPLSpell(spellId *proto.ActionID) *Spell {
}
}
} else {
spell = rot.unit.GetSpellAPL(actionID)
for _, s := range rot.unit.Spellbook {
if s.ActionID.SameAction(actionID) && s.Flags.Matches(SpellFlagAPL) {
spell = s
break
}
}
}

if spell == nil {
Expand Down
10 changes: 0 additions & 10 deletions sim/core/spell.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,16 +311,6 @@ func (unit *Unit) GetSpell(actionID ActionID) *Spell {
return nil
}

// Like GetSpell, but only returns spells with the APL flag set.
func (unit *Unit) GetSpellAPL(actionID ActionID) *Spell {
for _, spell := range unit.Spellbook {
if spell.ActionID.SameAction(actionID) && spell.Flags.Matches(SpellFlagAPL) {
return spell
}
}
return nil
}

// Retrieves an existing spell with the same ID as the config uses, or registers it if there is none.
func (unit *Unit) GetOrRegisterSpell(config SpellConfig) *Spell {
registered := unit.GetSpell(config.ActionID)
Expand Down

0 comments on commit cfececa

Please sign in to comment.