From aa12620376a5c4a1354ea9146543003bc168fee9 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 10 Jan 2025 15:49:16 +0200 Subject: [PATCH] Fix vision with temporary clouds over pools Vision wasn't cleared correctly when a temporary [poison] cloud was over a pool and hero was under water while the cloud disappeared. --- src/region.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/region.c b/src/region.c index b38f0487f..60001f866 100644 --- a/src/region.c +++ b/src/region.c @@ -357,11 +357,14 @@ remove_region(NhRegion *reg) reg->ttl = -2L; /* for visible_region_at */ if (reg->visible) { int pass; + boolean tmp_uinwater = u.uinwater; /* need to process the region's spots twice, first unblocking all locations which no longer block line-of-sight, then redrawing spots within revised line-of-sight; skip second pass if blind */ for (pass = 1; pass <= (Blind ? 1 : 2); ++pass) { + u.uinwater = (pass == 1) ? 0 : tmp_uinwater; + for (x = reg->bounding_box.lx; x <= reg->bounding_box.hx; x++) for (y = reg->bounding_box.ly; y <= reg->bounding_box.hy; y++) if (isok(x, y) && inside_region(reg, x, y)) { @@ -374,6 +377,7 @@ remove_region(NhRegion *reg) } } } + u.uinwater = tmp_uinwater; } free_region(reg); }