1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2024-12-29 16:00:16 +01:00

Fix node == nil bug. Reported on the forums.

This commit is contained in:
Splizard 2014-10-27 10:36:35 +13:00
parent 4d696c4843
commit 37ecfd02a8

View File

@ -86,6 +86,11 @@ function snow.place(pos)
if node and minetest.registered_nodes[node.name] then if node and minetest.registered_nodes[node.name] then
drawtype = minetest.registered_nodes[node.name].drawtype drawtype = minetest.registered_nodes[node.name].drawtype
end end
--Oops, maybe there is no node?
if node == nil then
return
end
local bnode = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) local bnode = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
if node.name == "default:snow" and minetest.get_node_level(pos) < 63 then if node.name == "default:snow" and minetest.get_node_level(pos) < 63 then