From: Perttu Ahola Date: Sat, 21 Jul 2012 13:36:14 +0000 (+0300) Subject: Check whether node is known before reading definition in __builtin:item:on_step() X-Git-Tag: 0.4.1~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=43df78102c0a95001443979827d747cfe5bd2e37;p=oweals%2Fminetest.git Check whether node is known before reading definition in __builtin:item:on_step() --- diff --git a/builtin/item_entity.lua b/builtin/item_entity.lua index a06afc5ea..2d763d50b 100644 --- a/builtin/item_entity.lua +++ b/builtin/item_entity.lua @@ -72,7 +72,8 @@ minetest.register_entity("__builtin:item", { local p = self.object:getpos() p.y = p.y - 0.3 local nn = minetest.env:get_node(p).name - if minetest.registered_nodes[nn].walkable then + -- If node is not registered or node is walkably solid + if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable then if self.physical_state then self.object:setvelocity({x=0,y=0,z=0}) self.object:setacceleration({x=0, y=0, z=0})