Drewol / unnamed-sdvx-clone

A game based on K-Shoot MANIA and Sound Voltex
MIT License
795 stars 96 forks source link

[Bug] Unix style LF newlines are not parsed correctly #673

Open Inconn opened 6 months ago

Inconn commented 6 months ago

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):

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

Inconn commented 6 months ago

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

Inconn commented 6 months ago

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