mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Replace sample bank fix with more correct fix
stable does not treat unknown enum members as `None` / `Auto`, it treats
them as `Normal`:
switch (sampleSet)
{
case SampleSet.Normal:
default:
sample = 0;
break;
case SampleSet.None:
case SampleSet.Soft:
sample = 1;
break;
case SampleSet.Drum:
sample = 2;
break;
}
(from 1531237b63/osu
!/Audio/AudioEngine.cs#L1158-L1171).
This commit is contained in:
parent
320a9fc171
commit
c4a0ca326e
@ -190,13 +190,18 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
string[] split = str.Split(':');
|
||||
|
||||
var bank = (LegacySampleBank)Parsing.ParseInt(split[0]);
|
||||
if (!Enum.IsDefined(bank))
|
||||
bank = LegacySampleBank.Normal;
|
||||
|
||||
var addBank = (LegacySampleBank)Parsing.ParseInt(split[1]);
|
||||
if (!Enum.IsDefined(addBank))
|
||||
addBank = LegacySampleBank.Normal;
|
||||
|
||||
string stringBank = bank.ToString().ToLowerInvariant();
|
||||
if (stringBank == @"none" || !Enum.IsDefined(bank))
|
||||
if (stringBank == @"none")
|
||||
stringBank = null;
|
||||
string stringAddBank = addBank.ToString().ToLowerInvariant();
|
||||
if (stringAddBank == @"none" || !Enum.IsDefined(addBank))
|
||||
if (stringAddBank == @"none")
|
||||
stringAddBank = null;
|
||||
|
||||
bankInfo.BankForNormal = stringBank;
|
||||
|
Loading…
Reference in New Issue
Block a user