1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Merge pull request #3680 from smoogipoo/fix-add-bank

Fix sample additions not falling back to non-addition bank
This commit is contained in:
Dean Herbert 2018-11-05 18:06:21 +09:00 committed by GitHub
commit 697b1f6728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -333,5 +333,18 @@ namespace osu.Game.Tests.Beatmaps.Formats
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);
}
}
}
}

View File

@ -0,0 +1,4 @@
osu file format v14
[HitObjects]
444,320,1000,5,2,3:0:1:0:

View File

@ -240,7 +240,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
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]);