From 0580b14310fac1113d9684eb3c9f4f80d058cea8 Mon Sep 17 00:00:00 2001 From: seventeenthShulker Date: Thu, 6 Jul 2023 14:17:54 +0200 Subject: [PATCH] Vertical pistons now save owner meta --- mods/ITEMS/REDSTONE/mesecons_pistons/init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua index 93b8df96d..262ac6eb5 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua @@ -138,14 +138,12 @@ local function piston_off(pos, node) end local function piston_orientate(pos, placer) - mesecon.mvps_set_owner(pos, placer) - -- not placed by player if not placer then return end - + -- placer pitch in degrees local pitch = placer:get_look_vertical() * (180 / math.pi) - + local node = minetest.get_node(pos) local pistonspec = minetest.registered_nodes[node.name].mesecons_piston if pitch > 55 then @@ -153,6 +151,9 @@ local function piston_orientate(pos, placer) elseif pitch < -55 then minetest.add_node(pos, {name=pistonspec.piston_down}) end + + -- set owner meta after setting node, or it will not keep + mesecon.mvps_set_owner(pos, placer) end