From 73b2c559d70922a8e791744c7a7549c23f2e603f Mon Sep 17 00:00:00 2001 From: teknomunk Date: Tue, 26 Nov 2024 20:06:45 -0600 Subject: [PATCH] Fix crash when piston moves observers very fast --- mods/ITEMS/REDSTONE/mcl_observers/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/REDSTONE/mcl_observers/init.lua b/mods/ITEMS/REDSTONE/mcl_observers/init.lua index 59a39173f..715398136 100644 --- a/mods/ITEMS/REDSTONE/mcl_observers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_observers/init.lua @@ -88,10 +88,12 @@ local function activate_observer(pos, node, def) end local function decay_on_observer(pos) + local original_name = get_node(pos).name core.after(mcl_vars.redstone_tick,function() local node = get_node(pos) - local def = core.registered_nodes[node.name] + if node.name ~= original_name then return end + local def = core.registered_nodes[node.name] local old_meta = minetest.get_meta(pos):to_table() node.name = def._mcl_observer_off_name minetest.set_node(pos, node)