mirror of
https://github.com/ppy/osu.git
synced 2026-05-17 11:22:54 +08:00
Fix case where there's only one player causing NaN
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
beb77176b6
commit
962ec3dca0
@@ -158,7 +158,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
return;
|
||||
}
|
||||
|
||||
float relativePosition = Math.Clamp((float)(position.Value.Value - 1) / (scores.Count - 1), 0, 1);
|
||||
float relativePosition = Math.Clamp((float)(position.Value.Value - 1) / Math.Max(scores.Count - 1, 1), 0, 1);
|
||||
|
||||
positionText.Current.Value = position.Value.Value;
|
||||
positionText.FadeTo(min_alpha + (max_alpha - min_alpha) * (1 - relativePosition), 1000, Easing.OutPow10);
|
||||
|
||||
Reference in New Issue
Block a user