From c28d6f3dc27bba0ec38cc759db50363413a25bd6 Mon Sep 17 00:00:00 2001 From: Milan2018 Date: Sun, 15 Mar 2020 13:17:01 +0100 Subject: [PATCH] =?UTF-8?q?Zm=C4=9Bnit=20"mesecons/mesecons=5Fmvps/init.lu?= =?UTF-8?q?a"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mesecons/mesecons_mvps/init.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mesecons/mesecons_mvps/init.lua b/mesecons/mesecons_mvps/init.lua index b8abdd7..7b76559 100644 --- a/mesecons/mesecons_mvps/init.lua +++ b/mesecons/mesecons_mvps/init.lua @@ -145,6 +145,10 @@ function mesecon.mvps_pull_single(pos, dir, maximum) return mesecon.mvps_push_or_pull(pos, vector.multiply(dir, -1), dir, maximum) end +function mesecon.mvps_is_protected(pos, ...) + return false +end + -- pos: pos of mvps; stackdir: direction of building the stack -- movedir: direction of actual movement -- maximum: maximum nodes to be pushed @@ -159,7 +163,13 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti return end end - + + for _, n in ipairs(nodes) do + if mesecon.mvps_is_protected(n.pos) then + return + end + end + -- remove all nodes for _, n in ipairs(nodes) do n.meta = minetest.get_meta(n.pos):to_table()