mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
fix instruments breaking when a song has a space at the end of a line (#34394)
This commit is contained in:
@@ -114,13 +114,15 @@
|
|||||||
|
|
||||||
var/lineCount = 1;
|
var/lineCount = 1;
|
||||||
for(var/line in lines)
|
for(var/line in lines)
|
||||||
//world << line
|
//to_chat(world, "line: [line]")
|
||||||
var/chordCount = 1;
|
var/chordCount = 1;
|
||||||
for(var/beat in splittext(lowertext(line), ","))
|
for(var/beat in splittext(lowertext(line), ","))
|
||||||
//world << "beat: [beat]"
|
//to_chat(world, "beat: [beat] / beat length: [length(beat)]")
|
||||||
|
if(!length(beat)) //This occurs when a comma is at the end of a line
|
||||||
|
beat = " " //It's intended to be a space so here we make it a space
|
||||||
var/list/notes = splittext(beat, "/")
|
var/list/notes = splittext(beat, "/")
|
||||||
for(var/note in splittext(notes[1], "-"))
|
for(var/note in splittext(notes[1], "-"))
|
||||||
//world << "note: [note]"
|
//to_chat(world, "note: [note]")
|
||||||
if(!playing || shouldStopPlaying(user))//If the instrument is playing, or special case
|
if(!playing || shouldStopPlaying(user))//If the instrument is playing, or special case
|
||||||
playing = 0
|
playing = 0
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user