From 4f3cdeaf054c2ccbd89f0da3edd3674184e6a9d2 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 2 Mar 2023 04:59:41 -0800 Subject: [PATCH] stub out reachability check for now it's more complicated than we thought --- plugins/buildingplan/buildingplan_cycle.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/buildingplan/buildingplan_cycle.cpp b/plugins/buildingplan/buildingplan_cycle.cpp index 375e26212..c8cd018e4 100644 --- a/plugins/buildingplan/buildingplan_cycle.cpp +++ b/plugins/buildingplan/buildingplan_cycle.cpp @@ -152,8 +152,19 @@ static df::building * popInvalidTasks(color_ostream &out, Bucket &task_queue, return NULL; } +// This is tricky. we want to choose an item that can be brought to the job site, but that's not +// necessarily the same as job->pos. it could be many tiles off in any direction (e.g. for bridges), or +// up or down (e.g. for stairs). static bool isAccessibleFrom(df::item *item, df::job *job) { - return Maps::canWalkBetween(Items::getPosition(item), job->pos); + // stub this out for now until we have a good algorithm. + // df::coord item_pos = Items::getPosition(item); + // const df::coord &job_pos = job->pos; + // return Maps::canWalkBetween(item_pos, job_pos) || + // Maps::canWalkBetween(item_pos, df::coord{job_pos.x-1, job_pos.y, job_pos.z}) || + // Maps::canWalkBetween(item_pos, df::coord{job_pos.x+1, job_pos.y, job_pos.z}) || + // Maps::canWalkBetween(item_pos, df::coord{job_pos.x, job_pos.y-1, job_pos.z}) || + // Maps::canWalkBetween(item_pos, df::coord{job_pos.x, job_pos.y+1, job_pos.z}); + return true; } static void doVector(color_ostream &out, df::job_item_vector_id vector_id,