forked from minetest-mods/nether
Fix error caused by teleporting offline players (#12)
This commit is contained in:
parent
6551f5c120
commit
b49f4ce73d
3
init.lua
3
init.lua
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user