diff options
author | Jeija <norrepli@gmail.com> | 2015-02-19 14:27:20 +0100 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2015-02-19 14:27:20 +0100 |
commit | eb416475cc511ebfa91d287f911afa9d66162199 (patch) | |
tree | c6561bf59e903b146c8144c2e23dc22a3841d5a3 | |
parent | 1ee3b2107db8dd5e36b773d446eece882ad27e2a (diff) | |
download | mesecons-eb416475cc511ebfa91d287f911afa9d66162199.tar mesecons-eb416475cc511ebfa91d287f911afa9d66162199.tar.gz mesecons-eb416475cc511ebfa91d287f911afa9d66162199.tar.bz2 mesecons-eb416475cc511ebfa91d287f911afa9d66162199.tar.xz mesecons-eb416475cc511ebfa91d287f911afa9d66162199.zip |
Re-add mesecon.register_mvps_unmov(objectname) since other mods (pipeworks) are using it
-rw-r--r-- | mesecons_mvps/init.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua index 8e6fd07..e7c9d5a 100644 --- a/mesecons_mvps/init.lua +++ b/mesecons_mvps/init.lua @@ -2,7 +2,18 @@ mesecon.mvps_stoppers = {} mesecon.on_mvps_move = {} +mesecon.mvps_unmov = {} +--- Objects (entities) that cannot be moved +function mesecon.register_mvps_unmov(objectname) + mesecon.mvps_unmov[objectname] = true; +end + +function mesecon.is_mvps_unmov(objectname) + return mesecon.mvps_unmov[objectname] +end + +-- Nodes that cannot be pushed / pulled by movestones, pistons function mesecon.is_mvps_stopper(node, pushdir, stack, stackid) local get_stopper = mesecon.mvps_stoppers[node.name] if type (get_stopper) == "function" then @@ -172,7 +183,7 @@ function mesecon.mvps_move_objects(pos, dir, nodestack) for _, obj in ipairs(objects_to_move) do local entity = obj:get_luaentity() - if not entity then + if not entity or not mesecon.is_mvps_unmov(entity.name) then local np = mesecon.addPosRule(obj:getpos(), dir) --move only if destination is not solid |