Skip to content

Commit 2d9f34c

Browse files
committedNov 2, 2013
Fix possible crash with grass ABM.
1 parent c21dccd commit 2d9f34c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎mods/default/nodes.lua

+6-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ minetest.register_abm({
137137
local above = {x=pos.x, y=pos.y+1, z=pos.z}
138138
local name = minetest.get_node(above).name
139139
local nodedef = minetest.registered_nodes[name]
140-
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none" and minetest.get_node_light(above) >= 13 then
140+
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light")
141+
and nodedef.liquidtype == "none"
142+
and (minetest.get_node_light(above) or 0) >= 13 then
141143
if name == "default:snow" or name == "default:snowblock" then
142144
minetest.set_node(pos, {name = "default:dirt_with_snow"})
143145
else
@@ -155,7 +157,9 @@ minetest.register_abm({
155157
local above = {x=pos.x, y=pos.y+1, z=pos.z}
156158
local name = minetest.get_node(above).name
157159
local nodedef = minetest.registered_nodes[name]
158-
if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none") then
160+
if name ~= "ignore" and nodedef
161+
and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light")
162+
and nodedef.liquidtype == "none") then
159163
minetest.set_node(pos, {name = "default:dirt"})
160164
end
161165
end

0 commit comments

Comments
 (0)