From 6b090e20c1beeb4a2bfdcc4b8c75c2322a589142 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 24 Jul 2026 20:33:18 +0300 Subject: [PATCH] ignore negative noise arguments --- res/modules/internal/extensions/math.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/res/modules/internal/extensions/math.lua b/res/modules/internal/extensions/math.lua index 97bbc33a6..f653bf80e 100644 --- a/res/modules/internal/extensions/math.lua +++ b/res/modules/internal/extensions/math.lua @@ -61,6 +61,7 @@ local function sample_noise(x) end function math.noise(x, octaves) + x = math.abs(x) octaves = octaves or 1 local value = 0.0 local mul = 1.0 @@ -81,6 +82,9 @@ local function rand_2d(x, y) end local function sample_noise2d(x, y) + x = math.abs(x) + y = math.abs(y) + local x0 = math.floor(x) local y0 = math.floor(y) local x1 = x0 + 1