diff options
author | Jeija <norrepli@gmail.com> | 2016-02-14 20:55:50 +0100 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2016-02-14 20:55:50 +0100 |
commit | 809192f353af2faeb779df85104d4d7ed8d8943d (patch) | |
tree | bf01d4afac6b7bd29deb0af92a7f7677ca6021c0 /mesecons_pistons/init.lua | |
parent | 6b54f025c16f29bd8049d5664b53d6ff6c30ce55 (diff) |
Use vector helper functions instead of old builtin cmpPos and addPosRule functions
Diffstat (limited to 'mesecons_pistons/init.lua')
-rw-r--r-- | mesecons_pistons/init.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index bad061a..5bf380c 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -57,7 +57,7 @@ end local piston_remove_pusher = function(pos, node) local pistonspec = minetest.registered_nodes[node.name].mesecons_piston local dir = piston_get_direction(pistonspec.dir, node) - local pusherpos = mesecon.addPosRule(pos, dir) + local pusherpos = vector.add(pos, dir) local pushername = minetest.get_node(pusherpos).name -- make sure there actually is a pusher (for compatibility reasons mainly) @@ -78,7 +78,7 @@ local piston_on = function(pos, node) local pistonspec = minetest.registered_nodes[node.name].mesecons_piston local dir = piston_get_direction(pistonspec.dir, node) - local np = mesecon.addPosRule(pos, dir) + local np = vector.add(pos, dir) local maxpush = mesecon.setting("piston_max_push", 15) local success, stack, oldstack = mesecon.mvps_push(np, dir, maxpush) if success then @@ -719,12 +719,12 @@ end local piston_get_stopper = function (node, dir, stack, stackid) pistonspec = minetest.registered_nodes[node.name].mesecons_piston dir = piston_get_direction(pistonspec.dir, node) - local pusherpos = mesecon.addPosRule(stack[stackid].pos, dir) + local pusherpos = vector.add(stack[stackid].pos, dir) local pushernode = minetest.get_node(pusherpos) if minetest.registered_nodes[node.name].mesecons_piston.pusher == pushernode.name then for _, s in ipairs(stack) do - if mesecon.cmpPos(s.pos, pusherpos) -- pusher is also to be pushed + if vector.equals(s.pos, pusherpos) -- pusher is also to be pushed and s.node.param2 == node.param2 then return false end |