do not crash on check overlap to not fully initialzied plans

This commit is contained in:
Alexander Weber 2018-08-09 07:35:54 +02:00
parent 63cacc2e5b
commit 85cfb2d773

View File

@ -121,9 +121,13 @@ local function create_new_plan(self)
-- check for possible overlaps with other plans -- check for possible overlaps with other plans
for plan_id, meta in pairs(plan_manager.plan_meta_list) do for plan_id, meta in pairs(plan_manager.plan_meta_list) do
local plan_meta = plan_manager.get_plan_meta(plan_id) local plan_meta = plan_manager.get_plan_meta(plan_id)
error_pos = tmp_next_plan:check_overlap(plan_meta:get_world_minp(), plan_meta:get_world_maxp(), 3, chk_pos) local minp = plan_meta:get_world_minp()
if error_pos then local maxp = plan_meta:get_world_maxp()
break if minp and maxp then
error_pos = tmp_next_plan:check_overlap(minp, maxp, 3, chk_pos)
if error_pos then
break
end
end end
end end
if not error_pos then if not error_pos then