mirror of
https://github.com/osukey/osukey.git
synced 2025-06-08 04:48:04 +09: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)
|
if (hitObject.Samples.Count > 0)
|
||||||
{
|
{
|
||||||
int volume = hitObject.Samples.Max(o => o.Volume);
|
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 };
|
yield return new LegacyBeatmapDecoder.LegacySampleControlPoint { Time = hitObject.GetEndTime(), SampleVolume = volume, CustomSampleBank = customIndex };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user