From 513413afc719a8c6c95ddbf5302c7528698772d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikita=20Wi=C5=9Bniewski?= Date: Thu, 19 Sep 2024 18:54:39 +0200 Subject: [PATCH] Use `remove_node` instead of `dig_node` in mcl_core ABMs (fixes #4628) (#4629) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mycelium ABM has been left untouched because of the potential destructiveness. If we ever find that to be an issue, it can be fixed as part of a bigger PR. Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4629 Reviewed-by: teknomunk Co-authored-by: Mikita Wiśniewski Co-committed-by: Mikita Wiśniewski --- mods/ITEMS/mcl_core/functions.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index eec432184..596a9c875 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -161,7 +161,7 @@ minetest.register_abm({ action = function(pos, node, active_object_count, active_object_count_wider) liquid_flow_action(pos, "water", function(pos) drop_attached_node(pos) - minetest.dig_node(pos) + minetest.remove_node(pos) end) end, }) @@ -217,7 +217,8 @@ minetest.register_abm({ while true do local node = minetest.get_node(lpos) if not node or node.name ~= "mcl_core:cactus" then break end - minetest.dig_node(lpos) + -- minetest.dig_node ignores protected nodes and causes infinite drop (#4628) + minetest.remove_node(lpos) dx = dx or ((math.random(0,1)-0.5) * math.sqrt(math.random())) * 1.5 dy = dy or ((math.random(0,1)-0.5) * math.sqrt(math.random())) * 1.5 local obj = minetest.add_item(vector.offset(lpos, dx, 0.25, dy), "mcl_core:cactus")