From 551a5cba4b45606dad6baa5c02410be07aa1385c Mon Sep 17 00:00:00 2001 From: myk002 Date: Mon, 7 Jun 2021 06:06:49 -0700 Subject: [PATCH] optimize test area search --- test/quickfort/ecosystem.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/quickfort/ecosystem.lua b/test/quickfort/ecosystem.lua index 286f271fa..73485ab63 100644 --- a/test/quickfort/ecosystem.lua +++ b/test/quickfort/ecosystem.lua @@ -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