Dont dry out soil if unloaded blocks are nearby

This commit is contained in:
PilzAdam 2014-12-03 18:46:02 +01:00
parent 20f938e44a
commit 22dd46dcc6

@ -113,16 +113,20 @@ minetest.register_abm({
minetest.set_node(pos, {name = wet}) minetest.set_node(pos, {name = wet})
end end
else else
-- turn it back into base if it is already dry -- only turn back if there are no unloaded blocks (and therefore
if wet_lvl == 0 then -- possible water sources) nearby
-- only turn it back if there is no plant/seed on top of it if not minetest.find_node_near(pos, 3, {"ignore"}) then
if minetest.get_item_group(nn.name, "plant") == 0 and minetest.get_item_group(nn.name, "seed") == 0 then -- turn it back into base if it is already dry
minetest.set_node(pos, {name = base}) if wet_lvl == 0 then
end -- only turn it back if there is no plant/seed on top of it
if minetest.get_item_group(nn.name, "plant") == 0 and minetest.get_item_group(nn.name, "seed") == 0 then
minetest.set_node(pos, {name = base})
end
-- if its wet turn it back into dry soil -- if its wet turn it back into dry soil
elseif wet_lvl == 1 then elseif wet_lvl == 1 then
minetest.set_node(pos, {name = dry}) minetest.set_node(pos, {name = dry})
end
end end
end end
end, end,