Fix error caused by teleporting offline players (#12)

This commit is contained in:
ㄗㄠˋ ㄑㄧˊ 2020-01-09 01:56:49 +08:00 committed by SmallJoker
parent 6551f5c120
commit b49f4ce73d

View File

@ -297,6 +297,9 @@ minetest.register_abm({
-- teleport the player -- teleport the player
minetest.after(3, function(o, p, t) minetest.after(3, function(o, p, t)
local objpos = o:getpos() local objpos = o:getpos()
if not objpos then -- player quit the game while teleporting
return
end
objpos.y = objpos.y + 0.1 -- Fix some glitches at -8000 objpos.y = objpos.y + 0.1 -- Fix some glitches at -8000
if minetest.get_node(objpos).name ~= "nether:portal" then if minetest.get_node(objpos).name ~= "nether:portal" then
return return