From 8c5ee06a0680c17e5b3affa56e09127b88230b68 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sun, 6 Jun 2021 08:43:27 +0100 Subject: [PATCH] add entity check --- schems.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/schems.lua b/schems.lua index b969544..ee4e82b 100644 --- a/schems.lua +++ b/schems.lua @@ -271,8 +271,8 @@ minetest.register_abm({ minetest.sound_play("default_tool_breaks", { pos = pos, gain = 1.0, - max_hear_distance = 10 - }) + max_hear_distance = 5 + }, true) local b_no = math.random(#lucky_block.wellblocks) local item = lucky_block.wellblocks[b_no][1] @@ -289,12 +289,14 @@ minetest.register_abm({ z = pos.z + math.random(-7, 7) }, "__builtin:falling_node") - obj:get_luaentity():set_node(nod) + if obj and obj:get_luaentity() then + obj:get_luaentity():set_node(nod) + end end end break end end - end, + end })