Merge pull request #11419 from Citadel-Station-13/Ghommie-patch-3-2

[s] Sanitizes ParseSong tempo.
This commit is contained in:
kevinz000
2020-03-10 17:14:38 -07:00
committed by GitHub
+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