From: Novatux Date: Sat, 2 Nov 2013 15:12:51 +0000 (+0100) Subject: Fix possible crash with grass ABM. X-Git-Tag: 0.4.8~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2d9f34cf29329bd7e8a02c393e88fb0501a5ba72;p=oweals%2Fminetest_game.git Fix possible crash with grass ABM. --- diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index b8cdf433..63b7305b 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -137,7 +137,9 @@ minetest.register_abm({ local above = {x=pos.x, y=pos.y+1, z=pos.z} local name = minetest.get_node(above).name local nodedef = minetest.registered_nodes[name] - if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none" and minetest.get_node_light(above) >= 13 then + if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") + and nodedef.liquidtype == "none" + and (minetest.get_node_light(above) or 0) >= 13 then if name == "default:snow" or name == "default:snowblock" then minetest.set_node(pos, {name = "default:dirt_with_snow"}) else @@ -155,7 +157,9 @@ minetest.register_abm({ local above = {x=pos.x, y=pos.y+1, z=pos.z} local name = minetest.get_node(above).name local nodedef = minetest.registered_nodes[name] - if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none") then + if name ~= "ignore" and nodedef + and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") + and nodedef.liquidtype == "none") then minetest.set_node(pos, {name = "default:dirt"}) end end