Drewol/unnamed-sdvx-clone

[Bug] Unix style LF newlines are not parsed correctly

Opened this issue · 2 comments

Describe the bug
When map files use Unix-style LF (\n) newlines instead of DOS-style CRLF (\r\n) newlines, they are not parsed correctly

To Reproduce
Steps to reproduce the behavior:

  1. Download https://ksm.dev/songs/68bc72a0-17e4-11ef-aeb9-476d797c94d2 (happens with any song that has LF newlines, but this one already has them, so it's broken on download)
  2. Notice that it is definitely not parsed correctly in the menu, and that trying to play it does not work at all

Expected behavior
Map files should be parsed correctly regardless of whether they use CRLF newlines or LF newlines, or at least automatically converted to CRLF newlines if they are using LF newlines.

Screenshots
When the files are using Unix-style LF newlines:
image
After converting the files to use DOS-style CRLF newlines
image

Desktop (please complete the following information):

  • OS: Arch Linux (using CachyOS)
  • GPU: NVIDIA RTX 3070
  • CPU: AMD Ryzen 7900X
  • Version: 2024-02-25_f264d380

I was also able to replicate this faulty behavior by converting a known good file to Unix-style LF newlines using dos2unix

Was able to fix this very easily by changing the occurances of "\r\n" to "\n" in https://github.com/Drewol/unnamed-sdvx-clone/blob/develop/Beatmap/src/KShootMap.cpp but idk if you want to come up with a better solution or something

nevermind doing that breaks all songs that use \r\n breaks

I'm assuming it leaves a loose "\r" at the end of the lines when you do that and that messes things up