From 2ef33501cc0b3df6b9ab7759ed54152c8b72e4a0 Mon Sep 17 00:00:00 2001 From: Desour Date: Thu, 22 Oct 2020 23:33:22 +0200 Subject: [PATCH] make ALL mvps stoppers non-replacable --- mesecons_mvps/init.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua index 2cccef2..1fb4865 100644 --- a/mesecons_mvps/init.lua +++ b/mesecons_mvps/init.lua @@ -55,16 +55,16 @@ end -- tests if the node can be pushed into, e.g. air, water, grass local function node_replaceable(name) - if name == "ignore" then - -- ignore is buildable_to, but we do not want to push into it + local nodedef = minetest.registered_nodes[name] + + -- everything that can be an mvps stopper (unknown nodes and nodes in the + -- mvps_stoppers table) must not be replacable + -- Note: ignore (a stopper) is buildable_to, but we do not want to push into it + if not nodedef or mesecon.mvps_stoppers[name] then return false end - if minetest.registered_nodes[name] then - return minetest.registered_nodes[name].buildable_to or false - end - - return false + return nodedef.buildable_to or false end function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)