Skip to content

Commit

Permalink
fix bad scoreboard start index calculation in evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Sep 16, 2020
1 parent 2eb4c98 commit 57ca384
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,26 @@ local function scoreitem(pn, index, scoreIndex, drawindex)
return t
end

curPage = 1
--can't have more lines than the # of scores huehuehu
if lines > #hsTable then
lines = #hsTable
curPage = 1
else
curPage = math.ceil(scoreIndex / (lines))
-- linear search for the score index to set the proper curPage
if scoreIndex > lines then
curPage = curPage + 1
local j = 0
for i = lines+1, #hsTable do
j = j + 1
if j == lines - 1 then
j = 0
curPage = curPage + 1
end
if i == scoreIndex then
break
end
end
end
end

-- weird math explanation can be found above somewhere
Expand Down

0 comments on commit 57ca384

Please sign in to comment.