mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
Vertical pistons now save owner meta
This commit is contained in:
parent
98cf3b7f7a
commit
0580b14310
1 changed files with 5 additions and 4 deletions
|
@ -138,14 +138,12 @@ local function piston_off(pos, node)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function piston_orientate(pos, placer)
|
local function piston_orientate(pos, placer)
|
||||||
mesecon.mvps_set_owner(pos, placer)
|
|
||||||
|
|
||||||
-- not placed by player
|
-- not placed by player
|
||||||
if not placer then return end
|
if not placer then return end
|
||||||
|
|
||||||
-- placer pitch in degrees
|
-- placer pitch in degrees
|
||||||
local pitch = placer:get_look_vertical() * (180 / math.pi)
|
local pitch = placer:get_look_vertical() * (180 / math.pi)
|
||||||
|
|
||||||
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
|
if pitch > 55 then
|
||||||
|
@ -153,6 +151,9 @@ local function piston_orientate(pos, placer)
|
||||||
elseif pitch < -55 then
|
elseif pitch < -55 then
|
||||||
minetest.add_node(pos, {name=pistonspec.piston_down})
|
minetest.add_node(pos, {name=pistonspec.piston_down})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- set owner meta after setting node, or it will not keep
|
||||||
|
mesecon.mvps_set_owner(pos, placer)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue