Skip to content

Commit

Permalink
Fix Rogue ItemSwap crash
Browse files Browse the repository at this point in the history
  • Loading branch information
1337LutZ committed Jan 17, 2025
1 parent 6ab05a9 commit 0e902b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions sim/core/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,13 @@ func (aa *AutoAttacks) NewPPMManager(ppm float64, procMask ProcMask) *DynamicPro
return &dpm
}

// PPMManager for static ProcMasks and no item swap callback
func (aa *AutoAttacks) NewStaticPPMManager(ppm float64, procMask ProcMask) *DynamicProcManager {
dpm := aa.newDynamicProcManager(ppm, 0, procMask)

return &dpm
}

// Dynamic Proc Manager for dynamic ProcMasks on weapon enchants
func (aa *AutoAttacks) NewDynamicProcManagerForEnchant(effectID int32, ppm float64, fixedProcChance float64) *DynamicProcManager {
return aa.newDynamicProcManagerWithDynamicProcMask(ppm, fixedProcChance, func() ProcMask {
Expand Down
2 changes: 1 addition & 1 deletion sim/rogue/poisons.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func (rogue *Rogue) UpdateInstantPoisonPPM(bonusChance float64) {
const basePPM = 0.2 / (1.4 / 60) // ~8.57, the former 20% normalized to a 1.4 speed weapon

ppm := basePPM * (1 + core.TernaryFloat64(rogue.Spec == proto.Spec_SpecAssassinationRogue, 0.5, 0) + bonusChance)
rogue.instantPoisonPPMM = rogue.AutoAttacks.NewPPMManager(ppm, procMask)
rogue.instantPoisonPPMM = rogue.AutoAttacks.NewStaticPPMManager(ppm, procMask)
}

func (rogue *Rogue) applyInstantPoison() {
Expand Down

0 comments on commit 0e902b5

Please sign in to comment.