1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-05 01:50:25 +01:00

fix teleport to nether don't work

This commit is contained in:
crabman77 2016-06-10 14:26:54 +02:00
parent 58d9a39312
commit 06d5335d90

View File

@ -686,22 +686,24 @@ function nether_port(player, pos)
pos.y = y
end
player:moveto(pos)
elseif nether.spawn_point then
player:moveto(nether.spawn_point)
else
set_portal(known_portals_u, pos.z,pos.x, pos.y)
local my = tonumber(meta:get_string("y"))
local y = get_portal(known_portals_d, pos.z,pos.x)
if y then
if y ~= my then
meta:set_string("y", y)
end
if nether.spawn_point then
pos = nether.spawn_point
else
y = my or portal_target+math.random(4)
end
pos.y = y
set_portal(known_portals_u, pos.z,pos.x, pos.y)
local my = tonumber(meta:get_string("y"))
local y = get_portal(known_portals_d, pos.z,pos.x)
if y then
if y ~= my then
meta:set_string("y", y)
end
else
y = my or portal_target+math.random(4)
end
pos.y = y
end
player:moveto(pos)
nether.player_to_nether(player, true)
end