MVPS: make stoppers non-replaceable even if they are buildable_to (#545)

This commit is contained in:
DS 2023-06-18 20:21:32 +02:00 committed by GitHub
parent 7f8758f17b
commit f98ea14023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,11 +53,16 @@ end
-- tests if the node can be pushed into, e.g. air, water, grass -- tests if the node can be pushed into, e.g. air, water, grass
local function node_replaceable(name) local function node_replaceable(name)
if minetest.registered_nodes[name] then local nodedef = minetest.registered_nodes[name]
return minetest.registered_nodes[name].buildable_to or false
-- 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 end
return false return nodedef.buildable_to or false
end end
function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky) function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)