Public lobbies map will now be picked from a randomized playlist, assuring each map is played at least once, without duplicates.

This commit is contained in:
NewHappyRabbit
2025-02-17 21:32:36 +02:00
parent 0f325d4be8
commit 2249f5207e
2 changed files with 18 additions and 1 deletions
+9
View File
@@ -47,4 +47,13 @@ export class PseudoRandom {
chance(odds: number): boolean {
return this.nextInt(0, odds) == 0;
}
shuffleArray(array: any[]) {
for (let i = array.length - 1; i >= 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
return array;
}
}