Closed silbinarywolf closed 1 year ago
The fix:
// Based on: https://stackoverflow.com/a/2450976/5013410
::ShuffleArray <- function(array) {
local currentIndex = array.len();
// While there remain elements to shuffle.
while (currentIndex > 0) {
// Pick a remaining element.
local randomIndex = RandomInt(0, currentIndex - 1);
currentIndex--;
// And swap it with the current element.
local current = array[currentIndex];
local random = array[randomIndex];
array[currentIndex] = random;
array[randomIndex] = current;
}
}
This will be fixed in 0.3.1
Discovered in playtesting tonight with some folks.