1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 16:52:55 +08:00

More generic catching for broken hitobject strings

This commit is contained in:
MillhioreF 2017-08-10 01:50:20 -05:00
parent 2e5a7374a8
commit e42c279229

View File

@ -18,10 +18,10 @@ namespace osu.Game.Rulesets.Objects.Legacy
internal abstract class ConvertHitObjectParser : HitObjectParser
{
public override HitObject Parse(string text)
{
try
{
string[] split = text.Split(',');
if (split.Length > 11)
throw new InvalidOperationException("One or more hit objects were malformed.");
ConvertHitObjectType type = (ConvertHitObjectType)int.Parse(split[3]) & ~ConvertHitObjectType.ColourHax;
bool combo = type.HasFlag(ConvertHitObjectType.NewCombo);
@ -164,6 +164,11 @@ namespace osu.Game.Rulesets.Objects.Legacy
return result;
}
catch (FormatException)
{
throw new FormatException("One or more hit objects were malformed.");
}
}
private void readCustomSampleBanks(string str, SampleBankInfo bankInfo)
{