mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2024-11-19 22:03:55 +01:00
Merge pull request #20 from OgelGames/master
Fix crashing when unknown nodes are near
This commit is contained in:
commit
d0d26f7666
3
init.lua
3
init.lua
@ -80,7 +80,8 @@ function tp.find_free_position_near(pos)
|
|||||||
}
|
}
|
||||||
for _,d in pairs(tries) do
|
for _,d in pairs(tries) do
|
||||||
local p = vector.add(pos, d)
|
local p = vector.add(pos, d)
|
||||||
if not minetest.registered_nodes[minetest.get_node(p).name].walkable then
|
local def = minetest.registered_nodes[minetest.get_node(p).name]
|
||||||
|
if def and not def.walkable then
|
||||||
return p, true
|
return p, true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user