diff --git a/worldgen-c/bin/worldgen b/worldgen-c/bin/worldgen index c85bbe8..526d856 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 84a18c2..0af2d75 100644 --- a/worldgen-c/src/worldgen.c +++ b/worldgen-c/src/worldgen.c @@ -2621,8 +2621,18 @@ static int build_trail_path(worldgen_ctx *ctx, double ax, double az, double bx, double next_height = heights[ni]; double slope = fabs(next_height - current_height); if (slope > 3.0) continue; + int water = 0; + int wx = (int)llround(min_x + nx * TRAIL_CELL_SIZE); + int wz = (int)llround(min_z + nz * TRAIL_CELL_SIZE); + column_data cd = get_column_data(ctx, wx, wz); + if (cd.has_water && next_height <= cd.water_surface) { + water = 1; + } double base_cost = (neighbors[n][0] == 0 || neighbors[n][1] == 0) ? 1.0 : 1.41421356237; double cost = base_cost * (1.0 + slope * 6.0); + if (water) { + cost += 10.0; + } if (dist[current] + cost < dist[ni]) { dist[ni] = dist[current] + cost; prev[ni] = current;