diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-07-21 16:36:14 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-07-21 16:36:14 +0300 |
commit | 43df78102c0a95001443979827d747cfe5bd2e37 (patch) | |
tree | 8905cfbd2f43631805029be9b543a9ad0055429b | |
parent | cc10eec6c6fd6252450f7d3af098e3936e43d3d9 (diff) | |
download | minetest-43df78102c0a95001443979827d747cfe5bd2e37.tar.gz minetest-43df78102c0a95001443979827d747cfe5bd2e37.tar.bz2 minetest-43df78102c0a95001443979827d747cfe5bd2e37.zip |
Check whether node is known before reading definition in __builtin:item:on_step()
-rw-r--r-- | builtin/item_entity.lua | 3 |
1 files changed, 2 insertions, 1 deletions
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}) |