From 1595b682cfee97dbfa2d3aad7cb9eb2751d44164 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 29 Aug 2024 07:02:40 -0700 Subject: [PATCH] do_clear_area() vs map column 0 do_clear_area() runs a callback over each point in a square around a center point. When executed near the edge of the map, it clips the square to avoid going over that edge. But on the left side, it was clipping to column 0 rather than 1, so running the callback routine on column 0 even though that isn't part of the level. This bug doesn't seem to have caused any problems though. --- src/vision.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vision.c b/src/vision.c index 34759bcad..d94c56bf4 100644 --- a/src/vision.c +++ b/src/vision.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 vision.c $NHDT-Date: 1707424350 2024/02/08 20:32:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.62 $ */ +/* NetHack 3.7 vision.c $NHDT-Date: 1724939600 2024/08/29 13:53:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.70 $ */ /* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2093,8 +2093,8 @@ do_clear_area( /* vision doesn't pass through water or clouds, detection should [this probably ought to be an arg supplied by our caller...] */ - override_vision = - (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) && detecting(func); + override_vision = (detecting(func) + && (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz))); if (range > MAX_RADIUS || range < 1) panic("do_clear_area: illegal range %d", range); @@ -2107,8 +2107,8 @@ do_clear_area( y = 0; for (; y <= max_y; y++) { offset = limits[v_abs(y - srow)]; - if ((min_x = (scol - offset)) < 0) - min_x = 0; + if ((min_x = (scol - offset)) < 1) + min_x = 1; if ((max_x = (scol + offset)) >= COLNO) max_x = COLNO - 1; for (x = min_x; x <= max_x; x++)