From 438811e108a1c28b63a4206128e8f38373e54ee5 Mon Sep 17 00:00:00 2001 From: bseiller Date: Tue, 19 Jan 2021 16:37:59 +0100 Subject: [PATCH] handling special case of the cursor having been positioned in the lower right corner before the search - matcher.cpp: manually moving the cursor to the neighbouring world tile so it can be moved back and embark_update is being called when all (incursion) data has been collected Co-Authored-By: PatrikLundell <22739822+PatrikLundell@users.noreply.github.com> --- plugins/embark-assistant/matcher.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/embark-assistant/matcher.cpp b/plugins/embark-assistant/matcher.cpp index 2b5e4728b..6fdbd04ba 100644 --- a/plugins/embark-assistant/matcher.cpp +++ b/plugins/embark-assistant/matcher.cpp @@ -3065,6 +3065,12 @@ uint16_t embark_assist::matcher::find(embark_assist::defs::match_iterators *iter iterator->active = !(iterator->i > world->worldgen.worldgen_parms.dim_y / 16); if (!iterator->active) { + // if the cursor was positioned in the lower right corner before the search it has to be moved to a neighbouring tile manually + // to force another call to embark_update when all (incursion) data is finally collected to make sure this specific world tile is properly reevaluated + // see the embark_update() in embark-assistant + if (iterator->x == world->worldgen.worldgen_parms.dim_x - 1 && iterator->y == world->worldgen.worldgen_parms.dim_y - 1) { + embark_assist::matcher::move_cursor(iterator->x - 1, iterator->y); + } embark_assist::matcher::move_cursor(iterator->x, iterator->y); if (!survey_results->at(0).at(0).survey_completed) { // Every world tile has gone through preliminary survey, so add possible incursion resources to each tile.