diff --git a/worldgen-c/bin/worldgen b/worldgen-c/bin/worldgen index 8e6d727..e2a4ac7 100755 Binary files a/worldgen-c/bin/worldgen and b/worldgen-c/bin/worldgen differ diff --git a/worldgen-c/src/worldgen.c b/worldgen-c/src/worldgen.c index 95c0bad..e3288a0 100644 --- a/worldgen-c/src/worldgen.c +++ b/worldgen-c/src/worldgen.c @@ -3830,7 +3830,12 @@ static void generate_chunk_border_wall(worldgen_ctx *ctx, int chunk_x, int chunk int smoothed_base = border_wall_ramp_base(ctx, side, along, wall_center, tower_spacing); int prev_base = border_wall_ramp_base(ctx, side, along - 1, wall_center, tower_spacing); int next_base = border_wall_ramp_base(ctx, side, along + 1, wall_center, tower_spacing); - int ramp_slope = next_base - prev_base; + int stair_slope = 0; + if (next_base > smoothed_base) { + stair_slope = 1; + } else if (prev_base > smoothed_base) { + stair_slope = -1; + } int height = in_tower ? tower_height : wall_height; int top = smoothed_base + height; @@ -3865,9 +3870,7 @@ static void generate_chunk_border_wall(worldgen_ctx *ctx, int chunk_x, int chunk if (rel_y <= 2 || rel_y % 6 == 0 || rel_y == height - 1) { block = BLOCK_STONE_BRICKS; } - if (side_dist >= wall_center - 1 && side_dist <= wall_center + 1 && rel_y == height && ramp_slope != 0) { - block = border_wall_ramp_stair_block(side, ramp_slope); - } else if (side_dist >= wall_center - 1 && side_dist <= wall_center + 1 && rel_y == height) { + if (side_dist >= wall_center - 1 && side_dist <= wall_center + 1 && rel_y == height) { block = BLOCK_STONE_BRICKS; } if (ladder_face && rel_y >= 2 && rel_y <= height) { @@ -3890,7 +3893,9 @@ static void generate_chunk_border_wall(worldgen_ctx *ctx, int chunk_x, int chunk } if (top + 1 < CHUNK_HEIGHT) { int rail_opening = ladder_module && side_dist == wall_end && ladder_offset <= 1; - if (!in_tower && !rail_opening && (side_dist == wall_start || side_dist == wall_end)) { + if (side_dist >= wall_center - 1 && side_dist <= wall_center + 1 && stair_slope != 0) { + set_block_with_height(out, dx, dz, top + 1, border_wall_ramp_stair_block(side, stair_slope)); + } else if (!in_tower && !rail_opening && (side_dist == wall_start || side_dist == wall_end)) { uint16_t rail_block = (side < 2) ? BLOCK_IRON_BARS_NS : BLOCK_IRON_BARS_EW; set_block_with_height(out, dx, dz, top + 1, rail_block); } else if (in_tower && phase % 4 < 2) {