mirror of
https://github.com/appgurueu/modlib.git
synced 2024-12-23 05:42:28 +01:00
Fix table.shuffle off-by-one error
This commit is contained in:
parent
c13f21c444
commit
022cd1a78e
@ -34,7 +34,7 @@ end
|
||||
-- Fisher-Yates
|
||||
function shuffle(table)
|
||||
for index = 1, #table - 1 do
|
||||
local index_2 = math.random(index + 1, #table)
|
||||
local index_2 = math.random(index, #table)
|
||||
table[index], table[index_2] = table[index_2], table[index]
|
||||
end
|
||||
return table
|
||||
|
Loading…
Reference in New Issue
Block a user