Merge pull request #20 from OgelGames/master

Fix crashing when unknown nodes are near
This commit is contained in:
ChaosWormz 2020-01-01 09:51:50 +02:00 committed by GitHub
commit d0d26f7666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -80,7 +80,8 @@ function tp.find_free_position_near(pos)
}
for _,d in pairs(tries) do
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
end
end