optimize test area search

develop
myk002 2021-06-07 06:06:49 -07:00
parent 232c85d258
commit 551a5cba4b
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 2 additions and 1 deletions

@ -131,7 +131,8 @@ local function get_test_area(area, spec)
-- keep this simple for now. just go down the layers and check the region
-- starting at the upper left corner of each level.
for z_start = df.global.world.map.z_count-1,0,-1 do
local startz = area.pos and area.pos.z or df.global.world.map.z_count-1
for z_start = startz,0,-1 do
local z_end = z_start - spec.depth + 1
if z_end < 1 then return false end
for z = z_start,z_end,-1 do