Skip to content

Commit

Permalink
Fix health display potentially desyncing from actual if health was ch…
Browse files Browse the repository at this point in the history
…anged during initial animation
  • Loading branch information
bdach committed Oct 6, 2023
1 parent 58448d3 commit ce0d4bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion osu.Game/Screens/Play/HUD/HealthDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ protected override void LoadComplete()
health = HealthProcessor.Health.GetBoundCopy();
health.BindValueChanged(h =>
{
Current.Value = h.NewValue;
finishInitialAnimation();
Current.Value = h.NewValue;
});

if (hudOverlay != null)
Expand Down Expand Up @@ -103,6 +103,11 @@ private void finishInitialAnimation()
{
initialIncrease?.Cancel();
initialIncrease = null;

// aside from the repeating `initialIncrease` scheduled task,
// there may also be a `Current` transform in progress from that schedule.
// ensure it plays out fully, to prevent changes to `Current.Value` being discarded by the ongoing transform.
FinishTransforms();
}

private void onNewJudgement(JudgementResult judgement)
Expand Down

0 comments on commit ce0d4bd

Please sign in to comment.