diff options
author | DS <vorunbekannt75@web.de> | 2017-09-11 21:26:04 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2017-09-11 21:26:04 +0200 |
commit | 42cd97392110993db6c19d9c8af2a468d72f2ab1 (patch) | |
tree | a064b3ec2ac0178dbae8541f2efd0a310439fbb9 /mesecons_mvps | |
parent | 36a6419481599c5b5ae2b43697722108fbc1d63d (diff) |
Do not stop node timers on mvps move (#359)
Diffstat (limited to 'mesecons_mvps')
-rw-r--r-- | mesecons_mvps/init.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua index 252acf7..08c4785 100644 --- a/mesecons_mvps/init.lua +++ b/mesecons_mvps/init.lua @@ -165,6 +165,10 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti -- remove all nodes for _, n in ipairs(nodes) do n.meta = minetest.get_meta(n.pos):to_table() + local node_timer = minetest.get_node_timer(n.pos) + if node_timer:is_started() then + n.node_timer = {node_timer:get_timeout(), node_timer:get_elapsed()} + end minetest.remove_node(n.pos) end @@ -179,6 +183,9 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti minetest.set_node(np, n.node) minetest.get_meta(np):from_table(n.meta) + if n.node_timer then + minetest.get_node_timer(np):set(unpack(n.node_timer)) + end end local moved_nodes = {} @@ -190,6 +197,7 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti moved_nodes[i].pos = nodes[i].pos moved_nodes[i].node = nodes[i].node moved_nodes[i].meta = nodes[i].meta + moved_nodes[i].node_timer = nodes[i].node_timer end on_mvps_move(moved_nodes) |