Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit af0b688

Browse files
committedNov 2, 2013
Fix possible crash with grass ABM.
1 parent 0d35350 commit af0b688

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎games/minimal/mods/default/init.lua

+6-2
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,9 @@ minetest.register_abm({
16181618
local above = {x=pos.x, y=pos.y+1, z=pos.z}
16191619
local name = minetest.get_node(above).name
16201620
local nodedef = minetest.registered_nodes[name]
1621-
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none" and minetest.get_node_light(above) >= 13 then
1621+
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light")
1622+
and nodedef.liquidtype == "none"
1623+
and (minetest.get_node_light(above) >= 13 or 0) then
16221624
if name == "default:snow" or name == "default:snowblock" then
16231625
minetest.set_node(pos, {name = "default:dirt_with_snow"})
16241626
else
@@ -1636,7 +1638,9 @@ minetest.register_abm({
16361638
local above = {x=pos.x, y=pos.y+1, z=pos.z}
16371639
local name = minetest.get_node(above).name
16381640
local nodedef = minetest.registered_nodes[name]
1639-
if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none") then
1641+
if name ~= "ignore" and nodedef
1642+
and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light")
1643+
and nodedef.liquidtype == "none") then
16401644
minetest.set_node(pos, {name = "default:dirt"})
16411645
end
16421646
end

0 commit comments

Comments
 (0)
Please sign in to comment.