1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Fix tournament match scores resetting if StartMatch is called on an in-progress match

This commit is contained in:
Dean Herbert 2022-09-08 16:07:21 +09:00
parent 85ce1bcea9
commit 9e42d6167f

View File

@ -106,13 +106,16 @@ namespace osu.Game.Tournament.Models
}
/// <summary>
/// Initialise this match with zeroed scores. Will be a noop if either team is not present.
/// Initialise this match with zeroed scores. Will be a noop if either team is not present or if either of the scores are non-zero.
/// </summary>
public void StartMatch()
{
if (Team1.Value == null || Team2.Value == null)
return;
if (Team1Score.Value > 0 || Team2Score.Value > 0)
return;
Team1Score.Value = 0;
Team2Score.Value = 0;
}