Water fountains now update themselves "staggered"

(ABM has a chance of 1 in 5 to run)
master
Ben Deutsch 2015-04-29 07:06:21 +02:00
parent e3538c3aff
commit 7da2f6e0b4
1 changed files with 2 additions and 2 deletions

View File

@ -658,7 +658,7 @@ minetest.register_craft({
minetest.register_abm({
nodenames = {'thirsty:water_fountain'},
interval = 2,
chance = 1,
chance = 5,
action = function(pos, node)
local fountain_count = 0
local water_count = 0
@ -683,8 +683,8 @@ minetest.register_abm({
end
end
end
--print(string.format("All the counts: %d + %d / %d", fountain_count, water_count, total_count))
local level = math.min(20, math.min(fountain_count, water_count))
--print(string.format("Fountain (%d): %d + %d / %d", level, fountain_count, water_count, total_count))
thirsty.fountains[string.format("%d:%d:%d", pos.x, pos.y, pos.z)] = {
pos = { x=pos.x, y=pos.y, z=pos.z },
level = level,