mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Fix sample additions not falling back to non-addition bank
This commit is contained in:
parent
09b2710fbf
commit
92d570342c
@ -333,5 +333,18 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
|
|
||||||
SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
osu.Game.Tests/Resources/hitobject-no-addition-bank.osu
Normal file
4
osu.Game.Tests/Resources/hitobject-no-addition-bank.osu
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
osu file format v14
|
||||||
|
|
||||||
|
[HitObjects]
|
||||||
|
444,320,1000,5,2,3:0:1:0:
|
@ -240,7 +240,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
stringAddBank = null;
|
stringAddBank = null;
|
||||||
|
|
||||||
bankInfo.Normal = stringBank;
|
bankInfo.Normal = stringBank;
|
||||||
bankInfo.Add = stringAddBank;
|
bankInfo.Add = string.IsNullOrEmpty(stringAddBank) ? stringBank : stringAddBank;
|
||||||
|
|
||||||
if (split.Length > 2)
|
if (split.Length > 2)
|
||||||
bankInfo.CustomSampleBank = int.Parse(split[2]);
|
bankInfo.CustomSampleBank = int.Parse(split[2]);
|
||||||
|
Loading…
Reference in New Issue
Block a user