From 42f4cbdc9c01e6237dc2fde00f703ec258779e59 Mon Sep 17 00:00:00 2001 From: myk002 Date: Fri, 1 Oct 2021 11:21:55 -0700 Subject: [PATCH] remove designations from all modified tiles found this bug with blueprint-generated blueprints. if both a channel and the resulting ramp are explicitly marked in the blueprint (like the blueprint plugin does), the channel is processed first, pre-creating the ramp in the tile designated for a ramp. Then, when the ramp designation is processed, the ramp is already there, which is an invalid tile to make a ramp on, so the designation is skipped (and therefore not cleared). this change clears the designation for both the ramp tile and the channel tile when either is processed. this opens another edge case where the designation under a channel is a regular 'd' mine, which will now get ignored and leave a ramp insead of a flat floor. but I'll address that in the next commit. --- plugins/dig-now.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/dig-now.cpp b/plugins/dig-now.cpp index 0abf935a4..788631990 100644 --- a/plugins/dig-now.cpp +++ b/plugins/dig-now.cpp @@ -597,10 +597,11 @@ static void do_dig(color_ostream &out, std::vector &dug_coords, !to.bits.dig_marked) { std::vector dug_tiles; if (dig_tile(out, map, pos, td.bits.dig, dug_tiles)) { - td = map.designationAt(pos); - td.bits.dig = df::tile_dig_designation::No; - map.setDesignationAt(pos, td); for (auto info : dug_tiles) { + td = map.designationAt(info.pos); + td.bits.dig = df::tile_dig_designation::No; + map.setDesignationAt(info.pos, td); + dug_coords.push_back(info.pos); refresh_adjacent_smooth_walls(map, info.pos); if (info.imat < 0)