mirror of
https://github.com/ElCeejo/creatura.git
synced 2025-04-30 13:51:41 -04:00
Fixing max spawn radius to also be spherical, like the spawn cap check
This commit is contained in:
parent
fe4f065bfc
commit
c99837fbde
1 changed files with 3 additions and 1 deletions
|
@ -167,9 +167,11 @@ function execute_spawns(player)
|
||||||
y = pos.y,
|
y = pos.y,
|
||||||
z = pos.z + random(-max_radius, max_radius)
|
z = pos.z + random(-max_radius, max_radius)
|
||||||
}
|
}
|
||||||
if vector.distance(pos, spawn_pos_center) < min_radius then
|
local dist = vector.distance(pos, spawn_pos_center)
|
||||||
|
if dist < min_radius or dist > max_radius then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local index_func
|
local index_func
|
||||||
if spawn.spawn_in_nodes then
|
if spawn.spawn_in_nodes then
|
||||||
index_func = minetest.find_nodes_in_area
|
index_func = minetest.find_nodes_in_area
|
||||||
|
|
Loading…
Add table
Reference in a new issue