1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 18:20:36 +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 pos.y = y
end end
player:moveto(pos) player:moveto(pos)
elseif nether.spawn_point then
player:moveto(nether.spawn_point)
else else
set_portal(known_portals_u, pos.z,pos.x, pos.y) if nether.spawn_point then
pos = nether.spawn_point
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 else
y = my or portal_target+math.random(4) set_portal(known_portals_u, pos.z,pos.x, pos.y)
end
pos.y = 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) player:moveto(pos)
nether.player_to_nether(player, true) nether.player_to_nether(player, true)
end end