Skip to content

Commit

Permalink
Merge pull request #4033 from vigo2/vigo/minorChanges
Browse files Browse the repository at this point in the history
vigo/minorChanges
  • Loading branch information
vigo2 committed Nov 12, 2023
2 parents 2cf9b60 + 85540eb commit f99e900
Show file tree
Hide file tree
Showing 9 changed files with 1,469 additions and 445 deletions.
8 changes: 8 additions & 0 deletions sim/core/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,14 @@ func (character *Character) Finalize() {

character.Unit.finalize()

// For now, restrict this optimization to rogues only. Ferals will require
// some extra logic to handle their ExcessEnergy() calc.
if character.Class == proto.Class_ClassRogue {
character.Env.RegisterPostFinalizeEffect(func() {
character.energyBar.setupEnergyThresholds()
})
}

character.majorCooldownManager.finalize()
character.ItemSwap.finalize()
}
Expand Down
11 changes: 1 addition & 10 deletions sim/core/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,6 @@ func (unit *Unit) finalize() {
for _, spell := range unit.Spellbook {
spell.finalize()
}

// For now, restrict this optimization to rogues only. Ferals will require
// some extra logic to handle their ExcessEnergy() calc.
agent := unit.Env.Raid.GetPlayerFromUnit(unit)
if agent != nil && agent.GetCharacter().Class == proto.Class_ClassRogue {
unit.Env.RegisterPostFinalizeEffect(func() {
unit.energyBar.setupEnergyThresholds()
})
}
}

func (unit *Unit) reset(sim *Simulation, _ Agent) {
Expand Down Expand Up @@ -563,7 +554,7 @@ func (unit *Unit) GetMetadata() *proto.UnitMetadata {
return metadata
}

func (unit *Unit) StartAPLLoop(sim *Simulation) {
func (unit *Unit) StartAPLLoop(_ *Simulation) {
if unit.HasManaBar() {
unit.ManaRequired = 0
}
Expand Down
Loading

0 comments on commit f99e900

Please sign in to comment.