From: ShadowNinja Date: Sun, 7 Sep 2014 00:34:52 +0000 (-0400) Subject: Fix farming unloaded node crash X-Git-Tag: 0.4.11~53 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=44dc61108886efd0eac5fcd29e1c73234d3b161c;p=oweals%2Fminetest_game.git Fix farming unloaded node crash --- diff --git a/mods/farming/api.lua b/mods/farming/api.lua index e6d57f80..6ce996d8 100644 --- a/mods/farming/api.lua +++ b/mods/farming/api.lua @@ -241,6 +241,9 @@ farming.register_plant = function(name, def) if minetest.get_item_group(node.name, "seed") and node_def.fertility then local can_grow = false local soil_node = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) + if not soil_node then + return + end for _, v in pairs(node_def.fertility) do if minetest.get_item_group(soil_node.name, v) ~= 0 then can_grow = true