forked from mtcontrib/nether-pack
Sort of fixed the multiple teleportation issue. The rest of this issue is a bug in minetest
This commit is contained in:
parent
414cc39999
commit
4c98df1b07
|
@ -787,8 +787,13 @@ minetest.register_abm({
|
||||||
if objs[1] ~= nil then
|
if objs[1] ~= nil then
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
local objpos = obj:getpos()
|
local objpos = obj:getpos()
|
||||||
|
local objmeta = minetest.env:get_meta(objpos)
|
||||||
if objpos.y>pos.y-1 and objpos.y<pos.y and obj:get_player_name() ~= nil and obj:get_player_name() ~= "" then
|
if objpos.y>pos.y-1 and objpos.y<pos.y and obj:get_player_name() ~= nil and obj:get_player_name() ~= "" then
|
||||||
|
if objmeta:get_string("teleporting") == "" or objmeta:get_string("teleporting") == nil then
|
||||||
|
objmeta:set_string("teleporting", "true")
|
||||||
nether:teleport_player(nether:inside_nether(obj:getpos()), obj)
|
nether:teleport_player(nether:inside_nether(obj:getpos()), obj)
|
||||||
|
objmeta:set_string("teleporting", "")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -532,7 +532,7 @@ function table_count(tt, item)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Remove duplicates from table
|
-- Remove duplicate positions from table
|
||||||
function table_unique(tt)
|
function table_unique(tt)
|
||||||
local newtable
|
local newtable
|
||||||
newtable = {}
|
newtable = {}
|
||||||
|
@ -726,6 +726,7 @@ function nether:teleport_player(from_nether, player)
|
||||||
teleportpos = {x=portalpos.x + coin2, y=portalpos.y + 1, z=portalpos.z + coin}
|
teleportpos = {x=portalpos.x + coin2, y=portalpos.y + 1, z=portalpos.z + coin}
|
||||||
end
|
end
|
||||||
player:setpos(teleportpos)
|
player:setpos(teleportpos)
|
||||||
|
objmeta:set_string("teleporting", "")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Portal Creator
|
-- Portal Creator
|
||||||
|
@ -787,8 +788,13 @@ minetest.register_abm({
|
||||||
if objs[1] ~= nil then
|
if objs[1] ~= nil then
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
local objpos = obj:getpos()
|
local objpos = obj:getpos()
|
||||||
|
local objmeta = minetest.env:get_meta(objpos)
|
||||||
if objpos.y>pos.y-1 and objpos.y<pos.y and obj:get_player_name() ~= nil and obj:get_player_name() ~= "" then
|
if objpos.y>pos.y-1 and objpos.y<pos.y and obj:get_player_name() ~= nil and obj:get_player_name() ~= "" then
|
||||||
|
if objmeta:get_string("teleporting") == "" or objmeta:get_string("teleporting") == nil then
|
||||||
|
objmeta:set_string("teleporting", "true")
|
||||||
nether:teleport_player(nether:inside_nether(obj:getpos()), obj)
|
nether:teleport_player(nether:inside_nether(obj:getpos()), obj)
|
||||||
|
objmeta:set_string("teleporting", "")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user