forked from Minetest/dynamic_liquid
fix crash in flow through
parent
103fd9a22a
commit
0ec396432b
|
@ -3,6 +3,9 @@ local flow_through_directions = {
|
|||
{{x=0,z=1},{x=1,z=0}},
|
||||
}
|
||||
|
||||
local get_node = minetest.get_node
|
||||
local set_node = minetest.set_node
|
||||
|
||||
dynamic_liquid.flow_through_abm = function(def)
|
||||
|
||||
minetest.register_abm({
|
||||
|
@ -20,7 +23,7 @@ dynamic_liquid.flow_through_abm = function(def)
|
|||
local source_flowing_node = dynamic_liquid.registered_liquids[source_node.name]
|
||||
local dest_flowing_node
|
||||
if source_flowing_node ~= nil then
|
||||
dest_node = minetest.get_node(dest_pos)
|
||||
dest_node = get_node(dest_pos)
|
||||
if dest_node.name == source_flowing_node or dest_node.name == "air" then
|
||||
set_node(dest_pos, source_node)
|
||||
set_node(source_pos, dest_node)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
local data = {}
|
||||
|
||||
dynamic_liquid.mapgen_prefill = function(def)
|
||||
|
||||
local water_level = def.liquid_level
|
||||
|
|
|
@ -35,5 +35,8 @@ if dynamic_liquid.config.springs then
|
|||
y_min = -15,
|
||||
pressure = 15,
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
if dynamic_liquid.config.mapgen_prefill then
|
||||
dynamic_liquid.mapgen_prefill({liquid="mcl_core:water_source", liquid_level=water_level})
|
||||
end
|
Loading…
Reference in New Issue