mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-30 23:03:45 +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
@ -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 New Issue
Block a user