diff --git a/simplex-noise.ts b/simplex-noise.ts index d99471a..71f8446 100644 --- a/simplex-noise.ts +++ b/simplex-noise.ts @@ -486,7 +486,7 @@ export function buildPermutationTable(random: RandomFn): Uint8Array { p[i] = i; } for (let i = 0; i < tableSize / 2 - 1; i++) { - const r = i + ~~(random() * (256 - i)); + const r = i + ~~(Math.random() * (256 - i)); const aux = p[i]; p[i] = p[r]; p[r] = aux; @@ -495,4 +495,4 @@ export function buildPermutationTable(random: RandomFn): Uint8Array { p[i] = p[i - 256]; } return p; -} \ No newline at end of file +}