From 2a10be4174f37d699047c425b1491b523a86f536 Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 13 Oct 2022 23:01:48 +0200 Subject: [PATCH 1/2] Fix possible crash in v6 / singlenode mapgen --- mods/MAPGEN/mcl_mapgen_core/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index baa3151dea..37d8857984 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -251,6 +251,7 @@ end local function set_palette(minp,maxp,data2,area,biomemap,nodes) -- Flat area at y=0 to read biome 3 times faster than 5.3.0.get_biome_data(pos).biome: 43us vs 125us per iteration: + if not biomemap then return end local aream = VoxelArea:new({MinEdge={x=minp.x, y=0, z=minp.z}, MaxEdge={x=maxp.x, y=0, z=maxp.z}}) local nodes = minetest.find_nodes_in_area(minp, maxp, nodes) for n=1, #nodes do From a8a55f9d6e3d8568a1dfae1b2987a2ffcedc6afd Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 13 Oct 2022 23:08:05 +0200 Subject: [PATCH 2/2] don't run block fixes at all in singlenode --- mods/MAPGEN/mcl_mapgen_core/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 37d8857984..3cd355b149 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -354,7 +354,7 @@ mcl_mapgen_core.register_generator("end_fixes", end_basic, function(minp,maxp) if maxp.y < mcl_vars.mg_end_min or minp.y > mcl_vars.mg_end_max then return end end, 9999, true) -if mg_name ~= "v6" then +if mg_name ~= "v6" and mg_name ~= "singlenode" then mcl_mapgen_core.register_generator("block_fixes", block_fixes, nil, 9999, true) end