Limit spawning of mobs outside y axis as well

This commit is contained in:
ancientmarinerdev 2023-01-31 18:13:36 +00:00
parent a8716c802f
commit 71c236646f
1 changed files with 1 additions and 1 deletions

View File

@ -815,7 +815,7 @@ if mobs_spawn then
repeat
local goal_pos = get_next_mob_spawn_pos(pos)
if math.abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math.abs(goal_pos.z) <= SPAWN_MAPGEN_LIMIT then
if math.abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math.abs(pos.y) <= SPAWN_MAPGEN_LIMIT and math.abs(goal_pos.z) <= SPAWN_MAPGEN_LIMIT then
local spawning_position_list = find_nodes_in_area_under_air(
{x = goal_pos.x, y = y_min, z = goal_pos.z},
{x = goal_pos.x, y = y_max, z = goal_pos.z},