From 8396e3f4532819eb680348a083bc64c0f0b2b987 Mon Sep 17 00:00:00 2001 From: Maxwell Winkler Date: Fri, 31 May 2024 21:50:18 -0500 Subject: [PATCH] fix unix-style lf newlines breaking maps --- Beatmap/src/KShootMap.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Beatmap/src/KShootMap.cpp b/Beatmap/src/KShootMap.cpp index 777424779..e9890f4c0 100644 --- a/Beatmap/src/KShootMap.cpp +++ b/Beatmap/src/KShootMap.cpp @@ -86,12 +86,13 @@ bool ParseKShootCourse(BinaryStream& input, Map& settings, Vecto uint32_t lineNumber = 0; String line; - static const String lineEnding = "\r\n"; + static const String lineEnding = "\n"; // Parse header (encoding-agnostic) while(TextStream::ReadLine(input, line, lineEnding)) { line.Trim(); + line.TrimBack('\r'); lineNumber++; if(line == "--") { @@ -133,6 +134,7 @@ bool ParseKShootCourse(BinaryStream& input, Map& settings, Vecto while (TextStream::ReadLine(input, line, lineEnding)) { line.Trim(); + line.TrimBack('\r'); lineNumber++; if (line.empty() || line[0] != '[') continue; @@ -182,12 +184,13 @@ bool KShootMap::Init(BinaryStream& input, bool metadataOnly) uint32_t lineNumber = 0; String line; - static const String lineEnding = "\r\n"; + static const String lineEnding = "\n"; // Parse header (encoding-agnostic) while(TextStream::ReadLine(input, line, lineEnding)) { line.Trim(); + line.TrimBack('\r'); lineNumber++; if(line == c_sep) { @@ -235,6 +238,7 @@ bool KShootMap::Init(BinaryStream& input, bool metadataOnly) KShootTime time = KShootTime(0, 0); while(TextStream::ReadLine(input, line, lineEnding)) { + line.TrimBack('\r'); if(line.empty()) { continue;