Skip to content

Commit 30857de

Browse files
committed
Add rudimentary support of rewinding failed state to health processor
As indicated in the inline comment this is very best effort, just to make the HP bar not very obviously stuck in a very obviously incorrect state after the replay is rewound from a failure. There's likely to be a bunch of replay accuracy issues related to this, but I'm just making the minimum effort to get this to work semi-acceptably for now.
1 parent 35a472a commit 30857de

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

osu.Game/Rulesets/Scoring/HealthProcessor.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,16 @@ protected override void ApplyResultInternal(JudgementResult result)
5959

6060
protected override void RevertResultInternal(JudgementResult result)
6161
{
62-
Health.Value = result.HealthAtJudgement;
62+
// TODO: this is rudimentary as to make rewinding failed replays work,
63+
// but it also acts up (sometimes rewinding a replay several times around the fail boundary moves the point of fail forward).
64+
// needs further investigation.
65+
if (result.FailedAtJudgement)
66+
HasFailed = false;
6367

64-
// Todo: Revert HasFailed state with proper player support
68+
if (HasFailed)
69+
return;
70+
71+
Health.Value = result.HealthAtJudgement;
6572
}
6673

6774
/// <summary>

0 commit comments

Comments
 (0)