From a4249091e0abffabc2f485fffa1298b7214574c9 Mon Sep 17 00:00:00 2001 From: varttist Date: Sat, 5 Sep 2026 21:35:41 +0300 Subject: [PATCH] `MapGen`: minor fix --- mods/CORE/MapGen/src/MapGen.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/CORE/MapGen/src/MapGen.lua b/mods/CORE/MapGen/src/MapGen.lua index 0e21452..afa0543 100644 --- a/mods/CORE/MapGen/src/MapGen.lua +++ b/mods/CORE/MapGen/src/MapGen.lua @@ -802,7 +802,7 @@ local function calcNoise2dValue(category, layer, triangle, x, y, z) -- If the triangle is monochromatic (all peaks have the same color and, -- accordingly, the same noise), then there is no point in smoothing out the noise. if triangleColor ~= nil then - return layer:getNoiseByColor(category, triangleColor):get_2d({x = x, y = z}) + return layer:getNoiseByColor(category, triangleColor):get_3d({x = x, y = 0, z = z}) end local peak1 = triangle.p1 @@ -821,15 +821,15 @@ local function calcNoise2dValue(category, layer, triangle, x, y, z) -- ( peak1 * weight1 + peak2 * weight2 + peak3 * weight3) / totalWeight, when -- totalWeight = weight1 + weight2 + weight3 local weight = calcWeight(triangle.h1, x, y, z) - noiseValue = noiseValue + noise1:get_2d({x = x, y = z}) * weight + noiseValue = noiseValue + noise1:get_3d({x = x, y = 0, z = z}) * weight totalWeight = totalWeight + weight weight = calcWeight(triangle.h2, x, y, z) - noiseValue = noiseValue + noise2:get_2d({x = x, y = z}) * weight + noiseValue = noiseValue + noise2:get_3d({x = x, y = 0, z = z}) * weight totalWeight = totalWeight + weight weight = calcWeight(triangle.h3, x, y, z) - noiseValue = noiseValue + noise3:get_2d({x = x, y = z}) * weight + noiseValue = noiseValue + noise3:get_3d({x = x, y = 0, z = z}) * weight totalWeight = totalWeight + weight return (noiseValue / totalWeight)