dirt grow abm was executed too often, todo: test if disabled catch_up makes it execute when it loads the node first
parent
09b1ec4b8e
commit
2c4a4723f4
8
init.lua
8
init.lua
|
@ -180,12 +180,20 @@ local function conifer_abm_rand_delay(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local can_grass_abm = true
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = "default:dirt_with_grass",
|
nodenames = "default:dirt_with_grass",
|
||||||
interval = INTERVAL,
|
interval = INTERVAL,
|
||||||
chance = 9.1,
|
chance = 9.1,
|
||||||
catch_up = false,
|
catch_up = false,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
|
if not can_grass_abm then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
can_grass_abm = false
|
||||||
|
minetest.after(INTERVAL, function()
|
||||||
|
can_grass_abm = true
|
||||||
|
end)
|
||||||
minetest.delay_function(INTERVAL-1, conifer_abm_rand_delay, pos)
|
minetest.delay_function(INTERVAL-1, conifer_abm_rand_delay, pos)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue