mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-11-16 07:10:32 +01:00
Remove excessive swaps
This commit is contained in:
parent
a8aeab965c
commit
48aa6f6a5b
|
@ -8,11 +8,10 @@ end
|
|||
|
||||
-- An on_rotate callback for mesecons components.
|
||||
function mesecon.on_rotate(pos, node, user, mode, new_param2)
|
||||
minetest.swap_node(pos, {name = "air"})
|
||||
local new_node = {name = node.name, param1 = node.param1, param2 = new_param2}
|
||||
minetest.swap_node(pos, new_node)
|
||||
mesecon.on_dignode(pos, node)
|
||||
node.param2 = new_param2
|
||||
minetest.swap_node(pos, node)
|
||||
mesecon.on_placenode(pos, node)
|
||||
mesecon.on_placenode(pos, new_node)
|
||||
minetest.check_for_falling(pos)
|
||||
return true
|
||||
end
|
||||
|
|
|
@ -263,12 +263,11 @@ minetest.register_on_placenode(function (pos, node)
|
|||
end)
|
||||
|
||||
function mesecon.buttonlike_onrotate(pos, node, user, mode, new_param2)
|
||||
minetest.swap_node(pos, {name = "air"})
|
||||
local new_node = {name = node.name, param1 = node.param1, param2 = new_param2}
|
||||
minetest.swap_node(pos, new_node)
|
||||
mesecon.receiver_remove(pos, node)
|
||||
mesecon.on_dignode(pos, node)
|
||||
node.param2 = new_param2
|
||||
minetest.swap_node(pos, node)
|
||||
mesecon.on_placenode(pos, node)
|
||||
mesecon.on_placenode(pos, new_node)
|
||||
mesecon.receiver_place(pos)
|
||||
minetest.check_for_falling(pos)
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue
Block a user