From 0dce58e8e4cbc11bd3f6f20cee4da09c0a0bd289 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 16 Apr 2022 16:35:44 +0200 Subject: [PATCH] Fix false loaded_areas update when click analyze --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index c77e282..96ef359 100644 --- a/init.lua +++ b/init.lua @@ -893,7 +893,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if (do_create or do_apply or do_analyze or fields.add_np_profile or fields.np_profiles) then if fields.offset and fields.scale and fields.seed and fields.spread_x and fields.spread_y and fields.spread_z and fields.octaves and fields.persistence and fields.lacunarity then - loaded_areas = {} local offset = tonumber(fields.offset) local scale = tonumber(fields.scale) local seed = tonumber(fields.seed) @@ -986,6 +985,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if not px or not py or not pz or not size then return end + if current_perlin.autogen then + loaded_areas = {} + end current_perlin.size = size local place_pos = vector.new(px, py, pz) local msg = S("Creating Perlin noise, please wait …") @@ -996,6 +998,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif msg == false then minetest.log("error", "[perlin_explorer] Error generating Perlin noise nodes!") end + elseif do_apply and current_perlin.autogen then + loaded_areas = {} end end end