From 93636fd1c37ba211e587fd8da3d386a672e507f3 Mon Sep 17 00:00:00 2001 From: Piratux <58703216+Piratux@users.noreply.github.com> Date: Sun, 9 Oct 2022 16:48:16 +0300 Subject: [PATCH] Cave terrain fixes --- maps/pirates/surfaces/islands/cave/cave.lua | 2 +- maps/pirates/surfaces/islands/cave/cave_source.lua | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/maps/pirates/surfaces/islands/cave/cave.lua b/maps/pirates/surfaces/islands/cave/cave.lua index 7f84a4cf..4b383bac 100644 --- a/maps/pirates/surfaces/islands/cave/cave.lua +++ b/maps/pirates/surfaces/islands/cave/cave.lua @@ -128,7 +128,7 @@ function Public.roll_source_surface(destination_data) cave_miner.cave_surface = game.create_surface(cave_surface_name, map_gen_settings) cave_miner.cave_surface.request_to_generate_chunks({x = 0, y = 0}, 2) - cave_miner.cave_surface.force_generate_chunk_requests() + -- cave_miner.cave_surface.force_generate_chunk_requests() -- Figure out if this is needed at all since it causes issues end function Public.cleanup_cave_surface(destination_data) diff --git a/maps/pirates/surfaces/islands/cave/cave_source.lua b/maps/pirates/surfaces/islands/cave/cave_source.lua index 6fb07aff..df92895f 100644 --- a/maps/pirates/surfaces/islands/cave/cave_source.lua +++ b/maps/pirates/surfaces/islands/cave/cave_source.lua @@ -309,17 +309,18 @@ local function get_biome(args) end function Public.terrain(args) + local tiles_placed = #args.tiles local biome, square_distance, noise = get_biome(args) biome(args, square_distance, noise) - -- fallback case when no tiles were placed - if #args.tiles == 0 then - -- args.tiles[#args.tiles + 1] = {name = 'dirt-7', position = args.p} - args.tiles[#args.tiles + 1] = {name = 'concrete', position = args.p} + -- fallback case when tile wasn't placed + if tiles_placed == #args.tiles then + args.tiles[#args.tiles + 1] = {name = 'dirt-7', position = args.p} end end +-- Finding a spot for structures is very hard (it might cause structures to spawn in weird locations, like ship) function Public.chunk_structures(args) end