1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 05:32:54 +08:00

fix legacy parser incorrectly assigning sample info for sliders

This commit is contained in:
OliBomby 2023-04-29 23:51:49 +02:00
parent f7c84030ac
commit ffcc8e91b2

View File

@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
} }
if (split.Length > 10) if (split.Length > 10)
readCustomSampleBanks(split[10], bankInfo); readCustomSampleBanks(split[10], bankInfo, true);
// One node for each repeat + the start and end nodes // One node for each repeat + the start and end nodes
int nodes = repeatCount + 2; int nodes = repeatCount + 2;
@ -182,7 +182,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
return result; return result;
} }
private void readCustomSampleBanks(string str, SampleBankInfo bankInfo) private void readCustomSampleBanks(string str, SampleBankInfo bankInfo, bool banksOnly = false)
{ {
if (string.IsNullOrEmpty(str)) if (string.IsNullOrEmpty(str))
return; return;
@ -202,6 +202,8 @@ namespace osu.Game.Rulesets.Objects.Legacy
bankInfo.BankForNormal = stringBank; bankInfo.BankForNormal = stringBank;
bankInfo.BankForAdditions = string.IsNullOrEmpty(stringAddBank) ? stringBank : stringAddBank; bankInfo.BankForAdditions = string.IsNullOrEmpty(stringAddBank) ? stringBank : stringAddBank;
if (banksOnly) return;
if (split.Length > 2) if (split.Length > 2)
bankInfo.CustomSampleBank = Parsing.ParseInt(split[2]); bankInfo.CustomSampleBank = Parsing.ParseInt(split[2]);