From e22650293dda921827d34f8beb49b12ea7ab04ca Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 25 Mar 2021 13:35:42 +0900 Subject: [PATCH 1/2] Remove unnecessary second call to StripComments in skin parsing logic --- osu.Game/Skinning/LegacySkinDecoder.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Skinning/LegacySkinDecoder.cs b/osu.Game/Skinning/LegacySkinDecoder.cs index 75b7ba28b9..2700f84815 100644 --- a/osu.Game/Skinning/LegacySkinDecoder.cs +++ b/osu.Game/Skinning/LegacySkinDecoder.cs @@ -17,8 +17,6 @@ namespace osu.Game.Skinning { if (section != Section.Colours) { - line = StripComments(line); - var pair = SplitKeyVal(line); switch (section) From 4f8edcd336c31694ad04c75d661f5c1873f0cf14 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 25 Mar 2021 13:35:54 +0900 Subject: [PATCH 2/2] Don't strip comments from metadata during parsin --- osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index 10a716963e..b39890084f 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -36,7 +36,13 @@ namespace osu.Game.Beatmaps.Formats if (ShouldSkipLine(line)) continue; - line = StripComments(line).TrimEnd(); + if (section != Section.Metadata) + { + // comments should not be stripped from metadata lines, as the song metadata may contain "//" as valid data. + line = StripComments(line); + } + + line = line.TrimEnd(); if (line.StartsWith('[') && line.EndsWith(']')) {