mirror of https://github.com/ppy/osu
Fix sample additions not falling back to non-addition bank
This commit is contained in:
parent
09b2710fbf
commit
92d570342c
|
@ -333,5 +333,18 @@ public void TestDecodeHitObjectFileSamples()
|
|||
|
||||
SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDecodeHitObjectNullAdditionBank()
|
||||
{
|
||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||
using (var resStream = Resource.OpenResource("hitobject-no-addition-bank.osu"))
|
||||
using (var stream = new StreamReader(resStream))
|
||||
{
|
||||
var hitObjects = decoder.Decode(stream).HitObjects;
|
||||
|
||||
Assert.AreEqual(hitObjects[0].Samples[0].Bank, hitObjects[0].Samples[1].Bank);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
osu file format v14
|
||||
|
||||
[HitObjects]
|
||||
444,320,1000,5,2,3:0:1:0:
|
|
@ -240,7 +240,7 @@ private void readCustomSampleBanks(string str, SampleBankInfo bankInfo)
|
|||
stringAddBank = null;
|
||||
|
||||
bankInfo.Normal = stringBank;
|
||||
bankInfo.Add = stringAddBank;
|
||||
bankInfo.Add = string.IsNullOrEmpty(stringAddBank) ? stringBank : stringAddBank;
|
||||
|
||||
if (split.Length > 2)
|
||||
bankInfo.CustomSampleBank = int.Parse(split[2]);
|
||||
|
|
Loading…
Reference in New Issue