Skip to content

Commit 5407724

Browse files
committed
Fix passive hp drop rate being too high in some cases
1 parent d64df01 commit 5407724

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

app/rulesets/osu/healthprocessor.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ func (hp *HealthProcessor) CalculateRate() { //nolint:gocyclo
126126
break
127127
}
128128

129-
hp.Increase(-hp.PassiveDrain*(o.GetEndTime()-o.GetStartTime()), false)
129+
decr := hp.PassiveDrain * (o.GetEndTime() - o.GetStartTime())
130+
hpUnder := min(0, hp.Health-decr)
131+
132+
hp.Increase(-decr, false)
130133

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

149+
//noinspection GoBoolExpressions - false positive
150+
if hpUnder < 0 && hp.Health+hpUnder <= lowestHpEver {
151+
fail = true
152+
hp.PassiveDrain *= 0.96
153+
154+
break
155+
}
156+
146157
if i == len(hp.beatMap.HitObjects)-1 || hp.beatMap.HitObjects[i+1].IsNewCombo() {
147158
hp.AddResult(Hit300g)
148159

0 commit comments

Comments
 (0)