Skip to content

Commit

Permalink
Fix hunter bug with autoattack callback
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyt857 committed Dec 23, 2022
1 parent 9b7a38f commit 426674c
Show file tree
Hide file tree
Showing 2 changed files with 317 additions and 317 deletions.
2 changes: 1 addition & 1 deletion sim/core/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ func (unit *Unit) EnableAutoAttacks(agent Agent, options AutoAttackOptions) {
baseDamage := spell.Unit.RangedWeaponDamage(sim, spell.RangedAttackPower(target)) +
spell.BonusWeaponDamage()
spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeRangedHitAndCrit)
agent.OnAutoAttack(sim, unit.AutoAttacks.RangedAuto)
},
}

Expand Down Expand Up @@ -555,6 +554,7 @@ func (aa *AutoAttacks) TrySwingRanged(sim *Simulation, target *Unit) {
aa.RangedAuto.Cast(sim, target)
aa.RangedSwingAt = sim.CurrentTime + aa.RangedSwingSpeed()
aa.PreviousSwingAt = sim.CurrentTime
aa.agent.OnAutoAttack(sim, aa.RangedAuto)
}

func (aa *AutoAttacks) UpdateSwingTime(sim *Simulation) {
Expand Down
Loading

0 comments on commit 426674c

Please sign in to comment.