From e46e1d96a7b382df862869a60bc997f27b90ecaf Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Sat, 27 May 2017 00:20:19 -0500 Subject: [PATCH] Move logic to handleEvent --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 6716af371c..2045293a58 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -208,6 +208,17 @@ namespace osu.Game.Beatmaps.Formats private void handleEvents(Beatmap beatmap, string val) { + do + { + 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); + string[] split = val.Split(','); EventType type; @@ -415,16 +426,6 @@ namespace osu.Game.Beatmaps.Formats handleDifficulty(beatmap, key, val); break; case Section.Events: - do - { - 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: