From e916f2294e7385c0d757cf6aa27269440e6ccc13 Mon Sep 17 00:00:00 2001 From: FajsiEx Date: Fri, 27 Aug 2021 21:31:46 +0200 Subject: [PATCH] + fallback bpm if songbpm cannot be parsed --- scripts/songselect/songwheel.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/songselect/songwheel.lua b/scripts/songselect/songwheel.lua index 9e00822..be9f07b 100644 --- a/scripts/songselect/songwheel.lua +++ b/scripts/songselect/songwheel.lua @@ -631,6 +631,13 @@ function tickTransitions(deltaTime) 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 else transitionFlashScale = 0