From 3a5e348d2c75c0cb52cb5786e30df93f9f3f2132 Mon Sep 17 00:00:00 2001 From: FajsiEx Date: Thu, 12 Aug 2021 22:34:38 +0200 Subject: [PATCH] / top and bottom gaps on songwheel if there aren't many songs to fill it --- scripts/songselect/songwheel.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/songselect/songwheel.lua b/scripts/songselect/songwheel.lua index ae02fa8..56b250c 100644 --- a/scripts/songselect/songwheel.lua +++ b/scripts/songselect/songwheel.lua @@ -163,6 +163,14 @@ end function getCorrectedIndex(from, offset) total = #songwheel.songs; + if (math.abs(offset) > total) then + if (offset < 0) then + offset = offset + total*math.floor(math.abs(offset)/total); + else + offset = offset - total*math.floor(math.abs(offset)/total); + end + end + index = from + offset; if index < 1 then