Allow artificial water sources to overwrite flows

Sponges can "time out" due to having been unloaded, and having
their check timer fire before an automated squeezer door timer
fires.  If this happens, the water needed to drain completely
before it could be re-squeezed, forcing a break in the water
flow.

This allows water sources to replace the water flows, so that
unbroken water sources will work even in load/unload boundary
conditions.
This commit is contained in:
Aaron Suen 2021-09-17 07:17:51 -04:00
parent 23509a7796
commit 92a9b2bed3

View File

@ -121,11 +121,13 @@ artificial water def:
function nodecore.artificial_water(pos, def, node)
node = node or minetest.get_node(pos)
local nn = node.name
if nn ~= graywatersrc and nn ~= graywaterflow then
local nd = minetest.registered_nodes[nn]
if not (nd and nd.floodable) then return end
if nd.on_flood and not nd.on_flood(
pos, node, {name = graywatersrc}) then return end
if nn ~= graywatersrc then
if nn ~= graywaterflow then
local nd = minetest.registered_nodes[nn]
if not (nd and nd.floodable) then return end
if nd.on_flood and not nd.on_flood(
pos, node, {name = graywatersrc}) then return end
end
nodecore.set_loud(pos, {name = graywatersrc})
end
local meta = minetest.get_meta(pos)