mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 08:29:34 +01:00
Fix End portal crash
This commit is contained in:
parent
3318c2f5f3
commit
6dbd120397
1 changed files with 3 additions and 1 deletions
|
@ -339,10 +339,12 @@ minetest.register_abm({
|
||||||
-- teleport the player
|
-- teleport the player
|
||||||
minetest.after(3, function(obj, pos, target3)
|
minetest.after(3, function(obj, pos, target3)
|
||||||
local objpos = obj:getpos()
|
local objpos = obj:getpos()
|
||||||
|
if objpos == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
-- If player stands, player is at ca. something+0.5
|
-- If player stands, player is at ca. something+0.5
|
||||||
-- which might cause precision problems, so we used ceil.
|
-- which might cause precision problems, so we used ceil.
|
||||||
objpos.y = math.ceil(objpos.y)
|
objpos.y = math.ceil(objpos.y)
|
||||||
if objpos == nil then return end --maikerumine added for objects to travel
|
|
||||||
if minetest.get_node(objpos).name ~= "mcl_portals:portal_end" then
|
if minetest.get_node(objpos).name ~= "mcl_portals:portal_end" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue