+ fallback bpm if songbpm cannot be parsed

This commit is contained in:
FajsiEx 2021-08-27 21:31:46 +02:00
parent 8cc36bdc4a
commit e916f2294e
1 changed files with 7 additions and 0 deletions

View File

@ -631,6 +631,13 @@ function tickTransitions(deltaTime)
end end
end end
-- If the original songBpm is "2021.04.01" for example, the above code can produce `nil` in the songBpm
-- since it cannot parse the number out of that string. Here we implement a fallback, to not crash
-- USC on whacky charts. Whacky charters, quit using batshit insane bpm values. It makes me angery >:(
if (songBpm == nil) then
songBpm = 120;
end
transitionFlashScale = transitionFlashScale + deltaTime / (60/songBpm) -- transition should last for that time in seconds transitionFlashScale = transitionFlashScale + deltaTime / (60/songBpm) -- transition should last for that time in seconds
else else
transitionFlashScale = 0 transitionFlashScale = 0