add an additional check to ensure old timers don't cause inappropriate growth

This commit is contained in:
FaceDeer 2022-08-01 14:50:07 -06:00
parent 1d7b6010c3
commit 0a61781b99

View File

@ -134,6 +134,8 @@ local place_seed = function(itemstack, placer, pointed_thing, plantname)
local growth_permitted_function = df_farming.growth_permitted[plantname] local growth_permitted_function = df_farming.growth_permitted[plantname]
if not growth_permitted_function or growth_permitted_function(pt.above) then if not growth_permitted_function or growth_permitted_function(pt.above) then
df_farming.plant_timer(pt.above, plantname) df_farming.plant_timer(pt.above, plantname)
else
minetest.get_node_timer(pt.above):stop() -- make sure no old timers are running on this node
end end
if not minetest.settings:get_bool("creative_mode", false) then if not minetest.settings:get_bool("creative_mode", false) then
itemstack:take_item() itemstack:take_item()