Fixed a bug where players quit when teleporting

This commit is contained in:
ㄗㄠˋ ㄑㄧˊ 2020-01-05 16:22:39 +08:00 committed by GitHub
parent 6551f5c120
commit 5645fe5209
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -295,7 +295,7 @@ minetest.register_abm({
vector.subtract(target, 4), vector.add(target, 4))
end
-- teleport the player
minetest.after(3, function(o, p, t)
minetest.after(3, function(o, p, t) pcall(function() -- avoid crashes when players exit
local objpos = o:getpos()
objpos.y = objpos.y + 0.1 -- Fix some glitches at -8000
if minetest.get_node(objpos).name ~= "nether:portal" then
@ -317,7 +317,7 @@ minetest.register_abm({
minetest.after(1, check_and_build_portal, p, t)
end, obj, pos, target)
end) end, obj, pos, target)
end
end
end