From 2dbacae56139c6d0d48acadb5a7bf686d10a51ea Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Fri, 16 Apr 2021 11:50:41 -0400 Subject: [PATCH] remove mapblocks from the queue early if they have no surfaces to work on (sadly can't be done for blocks in the deferred queue until they come out of "idle") --- init.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 2763926..44ddf30 100644 --- a/init.lua +++ b/init.lua @@ -511,8 +511,13 @@ function biome_lib.generate_block(shutting_down) biome_lib.pos_hash.surface_node_list = airflag and minetest.find_nodes_in_area_under_air(minp, maxp, biome_lib.surfaceslist_aircheck) or minetest.find_nodes_in_area(minp, maxp, biome_lib.surfaceslist_no_aircheck) - biome_lib.pos_hash.action_index = 1 - if #biome_lib.pos_hash.surface_node_list > 0 then + if #biome_lib.pos_hash.surface_node_list == 0 then + biome_lib.dbg("Mapblock at "..minetest.pos_to_string(minp).." dequeued: no detected surfaces.", 4) + table.remove(blocklog, 1) + biome_lib.pos_hash = nil + return + else + biome_lib.pos_hash.action_index = 1 biome_lib.dbg("Mapblock at "..minetest.pos_to_string(minp).. " has "..#biome_lib.pos_hash.surface_node_list.. " surface nodes to work on (airflag="..dump(airflag)..")", 4)