From 2b2ba47aeda2ad9758c8c3e14e8889ea06cff4b2 Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 27 Aug 2022 20:02:03 +0200 Subject: [PATCH] Fix crash with itementity and unloaded nodes --- mods/ENTITIES/mcl_item_entity/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index c482542b73..e8076606ed 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -853,9 +853,10 @@ minetest.register_entity(":__builtin:item", { -- If node is not registered or node is walkably solid and resting on nodebox local nn = minetest.get_node({x=p.x, y=p.y-0.5, z=p.z}).name + local def = minetest.registered_nodes[nn] local v = self.object:get_velocity() - local is_on_floor = (minetest.registered_nodes[nn].walkable - and not minetest.registered_nodes[nn].groups.slippery and v.y == 0) + local is_on_floor = def and (def.walkable + and not def.groups.slippery and v.y == 0) if not minetest.registered_nodes[nn] or is_floating or is_on_floor then