mirror of
https://github.com/minetest-mods/nether.git
synced 2024-09-27 14:50:38 +02:00
Fixed a bug where players quit when teleporting
This commit is contained in:
parent
6551f5c120
commit
5645fe5209
4
init.lua
4
init.lua
|
@ -295,7 +295,7 @@ minetest.register_abm({
|
||||||
vector.subtract(target, 4), vector.add(target, 4))
|
vector.subtract(target, 4), vector.add(target, 4))
|
||||||
end
|
end
|
||||||
-- teleport the player
|
-- 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()
|
local objpos = o:getpos()
|
||||||
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
|
||||||
|
@ -317,7 +317,7 @@ minetest.register_abm({
|
||||||
|
|
||||||
minetest.after(1, check_and_build_portal, p, t)
|
minetest.after(1, check_and_build_portal, p, t)
|
||||||
|
|
||||||
end, obj, pos, target)
|
end) end, obj, pos, target)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user