master
Thomas Rudin 2019-06-15 19:23:27 +02:00
parent 1157a7faec
commit 8a0d5bb038
2 changed files with 15 additions and 0 deletions

14
api.lua Normal file
View File

@ -0,0 +1,14 @@
-- returns true if pos occupied (with safety margin)
planetoidgen.is_occupied = function(pos)
for _, planet in ipairs(planetoidgen.planets) do
local distance = vector.distance(pos, planet.pos)
if distance < planet.radius+500 then
-- planet is here
return true
end
end
return false
end

View File

@ -10,6 +10,7 @@ planetoidgen = {
local MP = minetest.get_modpath("planetoidgen")
dofile(MP.."/planets.lua")
dofile(MP.."/api.lua")
dofile(MP.."/vacuum.lua")
dofile(MP.."/mapgen.lua")