limit the altitude due it multiplies twice and generated a big area

* just use a altitude of same area, above water if spawn anywhere is disable
* it generated too much counts, so we must limit the `altitude`..
* old code just multiplice the ratius in altitude..
* ...that will make the `find_nodes_in_area` search a big amount of area in air:
* closed closes https://codeberg.org/minenux/spawnnew/issues/7
* closed closes https://github.com/taikedz-mt/rspawn/issues/8
master
mckaygerhard 2021-10-21 15:19:21 -05:00
parent 4a643afeba
commit 4cb2b7a457
1 changed files with 5 additions and 1 deletions

View File

@ -52,7 +52,11 @@ end
function rspawn:get_positions_for(pos, radius)
local breadth = radius
local altitude = radius*2
local altitude = water_level + radius
if rspawn.spawnanywhere then
altitude = radius
end
local pos1 = {x=pos.x-breadth, y=pos.y, z=pos.z-breadth}
local pos2 = {x=pos.x+breadth, y=pos.y+altitude, z=pos.z+breadth}