From a523dfc3884c920ee3ea1bfba5496eabb17c6b6d Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Sat, 27 May 2017 00:13:46 -0500 Subject: [PATCH] Allow variables of variables Some storyboards like to do tricky stuff --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 78ef60748f..6716af371c 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -32,7 +32,7 @@ namespace osu.Game.Beatmaps.Formats private ConvertHitObjectParser parser; - private Dictionary variables = new Dictionary(); + private readonly Dictionary variables = new Dictionary(); private LegacySampleBank defaultSampleBank; private int defaultSampleVolume = 100; @@ -415,13 +415,16 @@ namespace osu.Game.Beatmaps.Formats handleDifficulty(beatmap, key, val); break; case Section.Events: - string[] valSplit = val.Split(','); - for (int i = 0; i < valSplit.Length; i++) + do { - if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i])) - valSplit[i] = variables[valSplit[i]]; - } - val = string.Join(",", valSplit); + string[] valSplit = val.Split(','); + for (int i = 0; i < valSplit.Length; i++) + { + if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i])) + valSplit[i] = variables[valSplit[i]]; + } + val = string.Join(",", valSplit); + } while (val.IndexOf('$') != -1); handleEvents(beatmap, val); break; case Section.TimingPoints: