Fixed review remarks

This commit is contained in:
ssdaniel24 2024-06-17 17:49:18 +03:00
parent c8a8f65a52
commit d79107af67

View file

@ -191,11 +191,8 @@ end
-- check if on wet soil -- check if on wet soil
farming.can_grow = function(pos) farming.can_grow = function(pos)
local below = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) local below = minetest.get_node(pos:offset(0, -1, 0))
if minetest.get_item_group(below.name, "soil") < 3 then return minetest.get_item_group(below.name, "soil") >= 3
return false
end
return true
end end
farming.grow_plant = function(pos, elapsed) farming.grow_plant = function(pos, elapsed)
@ -233,7 +230,7 @@ farming.grow_plant = function(pos, elapsed)
return return
end end
if (def.can_grow and def.can_grow(pos)) or (not def.can_grow and not farming.can_grow(pos)) then if not (def.can_grow or farming.can_grow)(pos) then
tick_again(pos) tick_again(pos)
return return
end end