From ca3db056921ab8732a778f4df36514547f8118c2 Mon Sep 17 00:00:00 2001 From: Aaron Suen Date: Fri, 20 Sep 2024 07:08:00 -0400 Subject: [PATCH] Fix portals in skyrealm "activating" for player/item return --- portal.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/portal.lua b/portal.lua index 124fc3c..9197551 100644 --- a/portal.lua +++ b/portal.lua @@ -55,14 +55,17 @@ end txr = tostring(txr) local function portaltick(pos, att, stack) - local inert = stack or att or api.in_sky_realm(pos) - local assign = getassign(stack and stack:get_meta() - or minetest.get_meta(pos), nil, true) - if assign then - local _, set = api.portaldata(assign) - set(pos) - if api.return_falling then api.return_falling(pos, assign) end - portalemerge(pos, assign) + local insky = api.in_sky_realm(pos) + local inert = insky or stack or att + if not insky then + local assign = getassign(stack and stack:get_meta() + or minetest.get_meta(pos), nil, true) + if assign then + local _, set = api.portaldata(assign) + set(pos) + if api.return_falling then api.return_falling(pos, assign) end + portalemerge(pos, assign) + end end if att then pos = {x = 0, y = 0, z = 0}