mirror of
https://github.com/ppy/osu
synced 2025-02-17 02:47:19 +00:00
Move clone to earlier in the process
This commit is contained in:
parent
caba78cb5d
commit
f16b4957aa
@ -694,9 +694,11 @@ namespace osu.Game.Screens.Play
|
|||||||
/// <returns>The final score.</returns>
|
/// <returns>The final score.</returns>
|
||||||
private async Task<ScoreInfo> prepareScoreForResults()
|
private async Task<ScoreInfo> prepareScoreForResults()
|
||||||
{
|
{
|
||||||
|
var scoreCopy = Score.DeepClone();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await PrepareScoreForResultsAsync(Score).ConfigureAwait(false);
|
await PrepareScoreForResultsAsync(scoreCopy).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -705,14 +707,14 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ImportScore(Score).ConfigureAwait(false);
|
await ImportScore(scoreCopy).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Error(ex, @"Score import failed!");
|
Logger.Error(ex, @"Score import failed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Score.ScoreInfo;
|
return scoreCopy.ScoreInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -38,15 +38,13 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected override APIRequest<MultiplayerScore> CreateSubmissionRequest(Score score, long token)
|
protected override APIRequest<MultiplayerScore> CreateSubmissionRequest(Score score, long token)
|
||||||
{
|
{
|
||||||
var scoreCopy = score.DeepClone();
|
var beatmap = score.ScoreInfo.Beatmap;
|
||||||
|
|
||||||
var beatmap = scoreCopy.ScoreInfo.Beatmap;
|
|
||||||
|
|
||||||
Debug.Assert(beatmap.OnlineBeatmapID != null);
|
Debug.Assert(beatmap.OnlineBeatmapID != null);
|
||||||
|
|
||||||
int beatmapId = beatmap.OnlineBeatmapID.Value;
|
int beatmapId = beatmap.OnlineBeatmapID.Value;
|
||||||
|
|
||||||
return new SubmitSoloScoreRequest(beatmapId, token, scoreCopy.ScoreInfo);
|
return new SubmitSoloScoreRequest(beatmapId, token, score.ScoreInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
var exiting = base.OnExiting(next);
|
var exiting = base.OnExiting(next);
|
||||||
|
|
||||||
submitScore(Score);
|
submitScore(Score.DeepClone());
|
||||||
|
|
||||||
return exiting;
|
return exiting;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user