From 627fec2e3a6dca3c6aff4003a4eefddd9d3d9bb8 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 29 Oct 2025 11:18:23 +0900 Subject: [PATCH] Add failing test case --- .../Visual/Matchmaking/TestSceneResultsScreen.cs | 15 +++++++++++++++ .../Matchmaking/Match/Results/SubScreenResults.cs | 14 +++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/Matchmaking/TestSceneResultsScreen.cs b/osu.Game.Tests/Visual/Matchmaking/TestSceneResultsScreen.cs index 4d1a40cc10..80bf660226 100644 --- a/osu.Game.Tests/Visual/Matchmaking/TestSceneResultsScreen.cs +++ b/osu.Game.Tests/Visual/Matchmaking/TestSceneResultsScreen.cs @@ -137,5 +137,20 @@ namespace osu.Game.Tests.Visual.Matchmaking MultiplayerClient.ChangeMatchRoomState(state).WaitSafely(); }); } + + [Test] + public void TestNoUsers() + { + AddStep("show results with no users", () => + { + var state = new MatchmakingRoomState + { + CurrentRound = 6, + Stage = MatchmakingStage.Ended + }; + + MultiplayerClient.ChangeMatchRoomState(state).WaitSafely(); + }); + } } } diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/Results/SubScreenResults.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/Results/SubScreenResults.cs index 797519a53c..9e47d161ba 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/Results/SubScreenResults.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/Results/SubScreenResults.cs @@ -255,27 +255,27 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.Results roomAwards.Clear(); long maxScore = long.MinValue; - int maxScoreUserId = 0; + int maxScoreUserId = -1; double maxAccuracy = double.MinValue; - int maxAccuracyUserId = 0; + int maxAccuracyUserId = -1; int maxCombo = int.MinValue; - int maxComboUserId = 0; + int maxComboUserId = -1; long maxBonusScore = 0; - int maxBonusScoreUserId = 0; + int maxBonusScoreUserId = -1; long largestScoreDifference = long.MinValue; - int largestScoreDifferenceUserId = 0; + int largestScoreDifferenceUserId = -1; long smallestScoreDifference = long.MaxValue; - int smallestScoreDifferenceUserId = 0; + int smallestScoreDifferenceUserId = -1; for (int round = 1; round <= state.CurrentRound; round++) { long roundHighestScore = long.MinValue; - int roundHighestScoreUserId = 0; + int roundHighestScoreUserId = -1; long roundLowestScore = long.MaxValue;