use swap_node instead of add_node

This commit is contained in:
Alexander Weber 2018-04-23 20:27:03 +02:00 committed by sofar
parent 5559e591a7
commit dd985c9a80

@ -21,7 +21,7 @@ local trampoline_punch = function(pos, node)
local id = string.sub(node.name, #node.name) local id = string.sub(node.name, #node.name)
if id < "6" then if id < "6" then
id = id + 1 id = id + 1
minetest.add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id}) minetest.swap_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id) minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
end end
end end
@ -30,7 +30,7 @@ local power_decrease = function(pos, node)
local id = string.sub(node.name, #node.name) local id = string.sub(node.name, #node.name)
if id > "1" then if id > "1" then
id = id - 1 id = id - 1
minetest.add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id}) minetest.swap_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id) minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
end end
end end