mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +08:00
fix invalidoperation exception
This commit is contained in:
parent
c6fc180659
commit
5accb05f45
@ -271,7 +271,9 @@ namespace osu.Game.Beatmaps.Formats
|
||||
if (hitObject.Samples.Count > 0)
|
||||
{
|
||||
int volume = hitObject.Samples.Max(o => o.Volume);
|
||||
int customIndex = hitObject.Samples.OfType<ConvertHitObjectParser.LegacyHitSampleInfo>().Max(o => o.CustomSampleBank);
|
||||
int customIndex = hitObject.Samples.Any(o => o is ConvertHitObjectParser.LegacyHitSampleInfo)
|
||||
? hitObject.Samples.OfType<ConvertHitObjectParser.LegacyHitSampleInfo>().Max(o => o.CustomSampleBank)
|
||||
: 0;
|
||||
yield return new LegacyBeatmapDecoder.LegacySampleControlPoint { Time = hitObject.GetEndTime(), SampleVolume = volume, CustomSampleBank = customIndex };
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user