Skip to content

Commit

Permalink
Re-add mesecon.register_mvps_unmov(objectname) since other mods (pipe…
Browse files Browse the repository at this point in the history
…works) are using it
  • Loading branch information
Jeija committed Feb 19, 2015
1 parent 1ee3b21 commit eb41647
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mesecons_mvps/init.lua
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eb41647

Please sign in to comment.