Fix portals in skyrealm "activating" for player/item return

This commit is contained in:
Aaron Suen 2024-09-20 07:08:00 -04:00
parent a57fe9a3c8
commit ca3db05692

View File

@ -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}