/ finally hopefully fix sorting regardless of ranking value
This commit is contained in:
parent
86af520c92
commit
0ad3016738
|
@ -575,8 +575,8 @@ function drawIrLeaderboard()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Becuase the scores are in "random order", we have to do this
|
-- Becuase the scores are in "random order", we have to do this
|
||||||
for i = 1, 4, 1 do
|
for index, irScore in ipairs(irLeaderboard) do
|
||||||
local irScore = irLeaderboard[i];
|
-- local irScore = irLeaderboard[i];
|
||||||
|
|
||||||
if irScore then
|
if irScore then
|
||||||
local rank = irScore.ranking
|
local rank = irScore.ranking
|
||||||
|
@ -682,7 +682,12 @@ end
|
||||||
|
|
||||||
function onIrLeaderboardFetched(res)
|
function onIrLeaderboardFetched(res)
|
||||||
if res.statusCode == IRData.States.Success then
|
if res.statusCode == IRData.States.Success then
|
||||||
irLeaderboard = res.body;
|
local tempIrLeaderboard = res.body;
|
||||||
|
|
||||||
|
for i, tempScore in ipairs(tempIrLeaderboard) do
|
||||||
|
irLeaderboard[tempScore.ranking] = tempScore
|
||||||
|
end
|
||||||
|
|
||||||
game.Log(dump(irLeaderboard), game.LOGGER_ERROR)
|
game.Log(dump(irLeaderboard), game.LOGGER_ERROR)
|
||||||
else
|
else
|
||||||
game.Log("IR error " .. res.statusCode, game.LOGGER_ERROR)
|
game.Log("IR error " .. res.statusCode, game.LOGGER_ERROR)
|
||||||
|
|
Loading…
Reference in New Issue