Overzealous replacement by defect dummies #33

This commit is contained in:
Joachim Stolberg 2019-06-04 20:17:44 +02:00
parent 5c4f117b40
commit 21c8be48f5

@ -37,10 +37,13 @@ function tubelib.data_not_corrupted(pos)
-- node moved? -- node moved?
local info = tubelib.get_node_info(number) local info = tubelib.get_node_info(number)
if not info or not vector.equals(info.pos, pos) then if not info or not vector.equals(info.pos, pos) then
tubelib.remove_node(pos) local node = minetest.get_node(pos)
minetest.set_node(pos, {name = "tubelib:defect_dummy"}) number = tubelib.get_new_number(pos, node.name)
meta:from_table(nil) meta:set_string("tubelib_number", number)
return false -- tubelib.remove_node(pos)
-- minetest.set_node(pos, {name = "tubelib:defect_dummy"})
-- meta:from_table(nil)
-- return false
end end
minetest.get_meta(pos):get_string("my_pos", minetest.pos_to_string(pos)) minetest.get_meta(pos):get_string("my_pos", minetest.pos_to_string(pos))
end end