forked from Mirrorlandia_minetest/mesecons
Fix pistons not connecting to wire and not activating when placing
up/down pistons from certain directions
This commit is contained in:
parent
7865d42834
commit
fe9c6871de
@ -117,10 +117,16 @@ local piston_orientate = function(pos, placer)
|
|||||||
|
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
local pistonspec = minetest.registered_nodes[node.name].mesecons_piston
|
||||||
if pitch > 55 then --looking upwards
|
|
||||||
minetest.set_node(pos, {name=pistonspec.piston_down})
|
-- looking upwards (pitch > 55) / looking downwards (pitch < -55)
|
||||||
elseif pitch < -55 then --looking downwards
|
local nn = nil
|
||||||
minetest.set_node(pos, {name=pistonspec.piston_up})
|
if pitch > 55 then nn = {name = pistonspec.piston_down} end
|
||||||
|
if pitch < -55 then nn = {name = pistonspec.piston_up} end
|
||||||
|
|
||||||
|
if nn then
|
||||||
|
minetest.set_node(pos, nn)
|
||||||
|
-- minetest.after, because on_placenode for unoriented piston must be processed first
|
||||||
|
minetest.after(0, mesecon.on_placenode, pos, nn)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user