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