Merge pull request #4569 from smoogipoo/fix-replay-parse-culture

Fix replays being parsed with incorrect cultures
This commit is contained in:
Dean Herbert 2019-04-01 11:40:53 +09:00 committed by GitHub
commit afd01b12f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Formats;
using osu.Game.Beatmaps.Legacy; using osu.Game.Beatmaps.Legacy;
using osu.Game.IO.Legacy; using osu.Game.IO.Legacy;
using osu.Game.Replays; using osu.Game.Replays;
@ -224,7 +225,7 @@ namespace osu.Game.Scoring.Legacy
continue; continue;
} }
var diff = float.Parse(split[0]); var diff = Parsing.ParseFloat(split[0]);
lastTime += diff; lastTime += diff;
// Todo: At some point we probably want to rewind and play back the negative-time frames // Todo: At some point we probably want to rewind and play back the negative-time frames
@ -232,7 +233,10 @@ namespace osu.Game.Scoring.Legacy
if (diff < 0) if (diff < 0)
continue; continue;
replay.Frames.Add(convertFrame(new LegacyReplayFrame(lastTime, float.Parse(split[1]), float.Parse(split[2]), (ReplayButtonState)int.Parse(split[3])))); replay.Frames.Add(convertFrame(new LegacyReplayFrame(lastTime,
Parsing.ParseFloat(split[1], Parsing.MAX_COORDINATE_VALUE),
Parsing.ParseFloat(split[2], Parsing.MAX_COORDINATE_VALUE),
(ReplayButtonState)Parsing.ParseInt(split[3]))));
} }
} }