Skip to content

Commit

Permalink
Fix farming unloaded node crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowNinja committed Sep 7, 2014
1 parent 49a8ddc commit 44dc611
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mods/farming/api.lua
Expand Up @@ -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
Expand Down

0 comments on commit 44dc611

Please sign in to comment.