MapGen: minor fix

This commit is contained in:
Van
2026-09-05 21:35:41 +03:00
parent 5a138cdf68
commit a4249091e0

View File

@@ -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)