Extend cabin paths and fix roof stair facing
This commit is contained in:
Binary file not shown.
@@ -1540,10 +1540,10 @@ static void build_cabin_roof(const cabin_blueprint *bp, int chunk_x, int chunk_z
|
|||||||
int lx_w = west_x - chunk_origin_x;
|
int lx_w = west_x - chunk_origin_x;
|
||||||
int lz = wz - chunk_origin_z;
|
int lz = wz - chunk_origin_z;
|
||||||
if (lx_e >= 0 && lx_e < CHUNK_SIZE && lz >= 0 && lz < CHUNK_SIZE) {
|
if (lx_e >= 0 && lx_e < CHUNK_SIZE && lz >= 0 && lz < CHUNK_SIZE) {
|
||||||
set_block_with_height(chunk, lx_e, lz, y, bp->stair_e_block);
|
set_block_with_height(chunk, lx_e, lz, y, bp->stair_w_block);
|
||||||
}
|
}
|
||||||
if (lx_w >= 0 && lx_w < CHUNK_SIZE && lz >= 0 && lz < CHUNK_SIZE) {
|
if (lx_w >= 0 && lx_w < CHUNK_SIZE && lz >= 0 && lz < CHUNK_SIZE) {
|
||||||
set_block_with_height(chunk, lx_w, lz, y, bp->stair_w_block);
|
set_block_with_height(chunk, lx_w, lz, y, bp->stair_e_block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1953,23 +1953,13 @@ static void connect_cabin_to_trail(worldgen_ctx *ctx, int chunk_x, int chunk_z,
|
|||||||
int step_z = (door_side == 0) ? -1 : (door_side == 1) ? 1 : 0;
|
int step_z = (door_side == 0) ? -1 : (door_side == 1) ? 1 : 0;
|
||||||
int start_x = door_x + step_x;
|
int start_x = door_x + step_x;
|
||||||
int start_z = door_z + step_z;
|
int start_z = door_z + step_z;
|
||||||
int spur_len = 12;
|
int spur_len = 20;
|
||||||
if (path_width < 2) path_width = 2;
|
if (path_width < 2) path_width = 2;
|
||||||
carve_cabin_path(ctx, chunk_x, chunk_z, chunk, columns, start_x, start_z, step_x, step_z, spur_len, path_width);
|
carve_cabin_path(ctx, chunk_x, chunk_z, chunk, columns, start_x, start_z, step_x, step_z, spur_len, path_width);
|
||||||
int target_x = 0, target_z = 0;
|
int target_x = 0, target_z = 0;
|
||||||
if (!find_nearest_trail_block(columns, chunk, chunk_x, chunk_z, start_x, start_z, 48, &target_x, &target_z)) {
|
if (!find_nearest_trail_block(columns, chunk, chunk_x, chunk_z, start_x, start_z, 64, &target_x, &target_z)) {
|
||||||
/* Fallback: extend a spur toward chunk edge */
|
int fallback_x = start_x + step_x * 48;
|
||||||
int edge_len = 32;
|
int fallback_z = start_z + step_z * 48;
|
||||||
int fallback_x = start_x + step_x * edge_len;
|
|
||||||
int fallback_z = start_z + step_z * edge_len;
|
|
||||||
int chunk_min_x = chunk_x * CHUNK_SIZE;
|
|
||||||
int chunk_max_x = chunk_min_x + CHUNK_SIZE - 1;
|
|
||||||
int chunk_min_z = chunk_z * CHUNK_SIZE;
|
|
||||||
int chunk_max_z = chunk_min_z + CHUNK_SIZE - 1;
|
|
||||||
if (fallback_x < chunk_min_x + 1) fallback_x = chunk_min_x + 1;
|
|
||||||
if (fallback_x > chunk_max_x - 1) fallback_x = chunk_max_x - 1;
|
|
||||||
if (fallback_z < chunk_min_z + 1) fallback_z = chunk_min_z + 1;
|
|
||||||
if (fallback_z > chunk_max_z - 1) fallback_z = chunk_max_z - 1;
|
|
||||||
carve_trail_span(ctx, chunk_x, chunk_z, chunk, columns, start_x, start_z, fallback_x, fallback_z, path_width);
|
carve_trail_span(ctx, chunk_x, chunk_z, chunk, columns, start_x, start_z, fallback_x, fallback_z, path_width);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user