aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods
diff options
context:
space:
mode:
authorNovatux <nathanael.courant@laposte.net>2013-11-02 16:13:07 +0100
committerPilzAdam <pilzadam@minetest.net>2013-11-02 16:22:26 +0100
commitd11c76b9f2ed111d933fe0df3cc5c87c8aff4f73 (patch)
tree3bd8e89890fee7fa32863f549479bdffa6987d3c /games/minimal/mods
parent0d35350b698a9b82722c8568e2f2d987068cdbaf (diff)
downloadminetest-d11c76b9f2ed111d933fe0df3cc5c87c8aff4f73.tar.gz
minetest-d11c76b9f2ed111d933fe0df3cc5c87c8aff4f73.tar.bz2
minetest-d11c76b9f2ed111d933fe0df3cc5c87c8aff4f73.zip
Fix possible crash with grass ABM.
Diffstat (limited to 'games/minimal/mods')
-rw-r--r--games/minimal/mods/default/init.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua
index 4e6ad67bd..eae1fabcc 100644
--- a/games/minimal/mods/default/init.lua
+++ b/games/minimal/mods/default/init.lua
@@ -1618,7 +1618,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
@@ -1636,7 +1638,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