Remove some portal hackery
parent
ec0219c66e
commit
54dc6e8ffb
|
@ -274,11 +274,11 @@ minetest.register_abm({
|
||||||
minetest.emerge_area(
|
minetest.emerge_area(
|
||||||
vector.subtract(target3, 4), vector.add(target3, 4))
|
vector.subtract(target3, 4), vector.add(target3, 4))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 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 --maikerumine added for objects to travel
|
if objpos == nil then return end --maikerumine added for objects to travel
|
||||||
objpos.y = objpos.y + 0.1 -- Fix some glitches at -8000. FIXME: WTF?
|
|
||||||
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
|
||||||
|
@ -289,13 +289,12 @@ minetest.register_abm({
|
||||||
if n and n.name ~= "mcl_portals:portal_end" then
|
if n and n.name ~= "mcl_portals:portal_end" then
|
||||||
build_end_portal(target3, pos)
|
build_end_portal(target3, pos)
|
||||||
minetest.after(2, check_and_build_end_portal, pos, target3)
|
minetest.after(2, check_and_build_end_portal, pos, target3)
|
||||||
minetest.after(4, check_and_build_end_portal, pos, target3)
|
|
||||||
elseif not n then
|
elseif not n then
|
||||||
minetest.after(1, check_and_build_end_portal, pos, target3)
|
minetest.after(1, check_and_build_end_portal, pos, target3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.after(1, check_and_build_end_portal, pos, target3)
|
check_and_build_end_portal(pos, target3)
|
||||||
|
|
||||||
-- Teleport
|
-- Teleport
|
||||||
obj:setpos(target3)
|
obj:setpos(target3)
|
||||||
|
|
|
@ -294,7 +294,6 @@ minetest.register_abm({
|
||||||
-- teleport the player
|
-- teleport the player
|
||||||
minetest.after(3, function(obj, pos, target)
|
minetest.after(3, function(obj, pos, target)
|
||||||
local objpos = obj:getpos() if objpos == nil then return end --maikerumine added for objects to travel
|
local objpos = obj:getpos() if objpos == nil then return end --maikerumine added for objects to travel
|
||||||
objpos.y = objpos.y + 0.1 -- Fix some glitches at -8000
|
|
||||||
if minetest.get_node(objpos).name ~= "mcl_portals:portal" then
|
if minetest.get_node(objpos).name ~= "mcl_portals:portal" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -305,13 +304,12 @@ minetest.register_abm({
|
||||||
if n and n.name ~= "mcl_portals:portal" then
|
if n and n.name ~= "mcl_portals:portal" then
|
||||||
build_portal(target, pos)
|
build_portal(target, pos)
|
||||||
minetest.after(2, check_and_build_portal, pos, target)
|
minetest.after(2, check_and_build_portal, pos, target)
|
||||||
minetest.after(4, check_and_build_portal, pos, target)
|
|
||||||
elseif not n then
|
elseif not n then
|
||||||
minetest.after(1, check_and_build_portal, pos, target)
|
minetest.after(1, check_and_build_portal, pos, target)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.after(1, check_and_build_portal, pos, target)
|
check_and_build_portal(pos, target)
|
||||||
|
|
||||||
-- Teleport
|
-- Teleport
|
||||||
obj:setpos(target)
|
obj:setpos(target)
|
||||||
|
|
Loading…
Reference in New Issue