mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:23:22 +08:00
Fix lack of fallback logic for custom bank samples
Closes #2966. --- Was causing some beatmaps to not play all of their hitsounds
This commit is contained in:
parent
abfebbddd9
commit
ba258b8a05
@ -29,6 +29,11 @@ namespace osu.Game.Audio
|
||||
/// </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// An optional suffix to provide priority lookup. Falls back to non-suffixed <see cref="Name"/>.
|
||||
/// </summary>
|
||||
public string Suffix;
|
||||
|
||||
/// <summary>
|
||||
/// The sample volume.
|
||||
/// </summary>
|
||||
@ -41,9 +46,15 @@ namespace osu.Game.Audio
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Suffix))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Namespace))
|
||||
yield return $"{Namespace}/{Bank}-{Name}{Suffix}";
|
||||
yield return $"{Bank}-{Name}{Suffix}"; // Without namespace as a fallback even when we have a namespace
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Namespace))
|
||||
yield return $"{Namespace}/{Bank}-{Name}";
|
||||
|
||||
yield return $"{Bank}-{Name}"; // Without namespace as a fallback even when we have a namespace
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
var baseInfo = base.ApplyTo(sampleInfo);
|
||||
|
||||
if (CustomSampleBank > 1)
|
||||
baseInfo.Name += CustomSampleBank;
|
||||
baseInfo.Suffix = CustomSampleBank.ToString();
|
||||
|
||||
return baseInfo;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user