mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:03:08 +08:00
Merge pull request #1342 from smoogipoo/fix-storyboard-exception
Fix trimming too early in OsuLegacyDecoder crashing storyboards
This commit is contained in:
commit
6542079385
@ -611,9 +611,9 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
CommandTimelineGroup timelineGroup = null;
|
CommandTimelineGroup timelineGroup = null;
|
||||||
|
|
||||||
string line;
|
string line;
|
||||||
while ((line = stream.ReadLine()?.Trim()) != null)
|
while ((line = stream.ReadLine()) != null)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(line))
|
if (string.IsNullOrWhiteSpace(line))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (line.StartsWith("//"))
|
if (line.StartsWith("//"))
|
||||||
@ -679,10 +679,12 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private KeyValuePair<string, string> splitKeyVal(string line, char separator)
|
private KeyValuePair<string, string> splitKeyVal(string line, char separator)
|
||||||
{
|
{
|
||||||
|
var split = line.Trim().Split(new[] { separator }, 2);
|
||||||
|
|
||||||
return new KeyValuePair<string, string>
|
return new KeyValuePair<string, string>
|
||||||
(
|
(
|
||||||
line.Remove(line.IndexOf(separator)).Trim(),
|
split[0].Trim(),
|
||||||
line.Substring(line.IndexOf(separator) + 1).Trim()
|
split.Length > 1 ? split[1].Trim() : string.Empty
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user