From 6b84fa82fcdbbeebe37856a89f4cd02c2a6cfb42 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 19 Oct 2024 05:37:10 +0300 Subject: [PATCH] fix: non-air lines are not placed --- src/world/generator/WorldGenerator.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/world/generator/WorldGenerator.cpp b/src/world/generator/WorldGenerator.cpp index 08b0b7f2..8acc76e1 100644 --- a/src/world/generator/WorldGenerator.cpp +++ b/src/world/generator/WorldGenerator.cpp @@ -560,10 +560,13 @@ void WorldGenerator::generateLine( a, b, point ); if (y > 0 && - util::distance2(closest, point) <= radius * radius && - line.block == BLOCK_AIR + util::distance2(closest, point) <= radius * radius ) { auto& voxel = voxels[vox_index(x, y, z)]; + if (line.block != BLOCK_AIR) { + voxel = {line.block, {}}; + continue; + } if (!indices.require(voxel.id).replaceable) { voxel = {line.block, {}}; }