mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 07:43:01 +08:00
Merge pull request #2276 from peppy/ignore-unknown-sections
Don't hard-crash when an unknown section is encountered in a legacy file
This commit is contained in:
commit
977e73bba2
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using osu.Framework.Logging;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps.Formats
|
namespace osu.Game.Beatmaps.Formats
|
||||||
@ -31,7 +32,11 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
if (line.StartsWith(@"[") && line.EndsWith(@"]"))
|
if (line.StartsWith(@"[") && line.EndsWith(@"]"))
|
||||||
{
|
{
|
||||||
if (!Enum.TryParse(line.Substring(1, line.Length - 2), out section))
|
if (!Enum.TryParse(line.Substring(1, line.Length - 2), out section))
|
||||||
throw new InvalidDataException($@"Unknown osu section {line}");
|
{
|
||||||
|
Logger.Log($"Unknown section \"{line}\" in {beatmap}");
|
||||||
|
section = Section.None;
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user