Skip to content

Commit

Permalink
Fix passive hp drop rate being too high in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Wieku committed Sep 18, 2023
1 parent d64df01 commit 5407724
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/rulesets/osu/healthprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ func (hp *HealthProcessor) CalculateRate() { //nolint:gocyclo
break
}

hp.Increase(-hp.PassiveDrain*(o.GetEndTime()-o.GetStartTime()), false)
decr := hp.PassiveDrain * (o.GetEndTime() - o.GetStartTime())
hpUnder := min(0, hp.Health-decr)

hp.Increase(-decr, false)

if s, ok := o.(*objects.Slider); ok {
for j := 0; j < len(s.TickReverse)+1; j++ {
Expand All @@ -143,6 +146,14 @@ func (hp *HealthProcessor) CalculateRate() { //nolint:gocyclo
}
}

//noinspection GoBoolExpressions - false positive
if hpUnder < 0 && hp.Health+hpUnder <= lowestHpEver {
fail = true
hp.PassiveDrain *= 0.96

break
}

if i == len(hp.beatMap.HitObjects)-1 || hp.beatMap.HitObjects[i+1].IsNewCombo() {
hp.AddResult(Hit300g)

Expand Down

0 comments on commit 5407724

Please sign in to comment.