[s] Sanitizes ParseSong tempo.

This commit is contained in:
Ghom
2020-03-11 00:29:31 +01:00
committed by GitHub
parent 6757eece5c
commit 0d7612dcf5
+2 -1
View File
@@ -203,7 +203,8 @@
if(lines.len)
var/bpm_string = "BPM: "
if(findtext(lines[1], bpm_string, 1, length(bpm_string) + 1))
tempo = sanitize_tempo(600 / text2num(copytext(lines[1], length(bpm_string) + 1)))
var/divisor = text2num(copytext(lines[1], length(bpm_string) + 1)) || 120 // default
tempo = sanitize_tempo(600 / round(divisor, 1))
lines.Cut(1, 2)
else
tempo = sanitize_tempo(5) // default 120 BPM