mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Change y range calculation to use outer zone distance and not middle to let mobs spawn far away from the player
This commit is contained in:
parent
1bc0a0b411
commit
2a014ca79c
1 changed files with 1 additions and 1 deletions
|
@ -648,7 +648,7 @@ local function get_next_mob_spawn_pos(pos)
|
|||
end
|
||||
|
||||
-- Calculate upper/lower y limits
|
||||
local R1 = MOB_SPAWN_ZONE_MIDDLE
|
||||
local R1 = MOB_SPAWN_ZONE_OUTER
|
||||
local d = vector_distance( pos, vector.new( goal_pos.x, pos.y, goal_pos.z ) ) -- distance from player to projected point on horizontal plane
|
||||
local y1 = math_sqrt( R1*R1 - d*d ) -- absolue value of distance to outer sphere
|
||||
|
||||
|
|
Loading…
Reference in a new issue