]> granicus.if.org Git - nethack/commitdiff
more zapping while hiding-under
authorPatR <rankin@nethack.org>
Sun, 11 Dec 2022 02:00:44 +0000 (18:00 -0800)
committerPatR <rankin@nethack.org>
Sun, 11 Dec 2022 02:00:44 +0000 (18:00 -0800)
The previous commit had the up/down test backward.  Also the commit
log text described the old behavior incorrectly:  zapping down while
hiding-under skipped the top item but zapping up hit the whole pile.

Still not adequately tested.

src/zap.c

index b77e6a024d05695c1b07986401bdf90caecb5c87..99b31b139e54b052ad5af95bd5eae8df8d6e82ea 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -2305,11 +2305,11 @@ bhitpile(
         if (hidingunder) {
             if (first) {
                 first = FALSE; /* reset for next item */
-                if (zz < 0) /* down when hiding-under skips first item */
+                if (zz > 0) /* down when hiding-under skips first item */
                     continue;
             } else {
                 /* !first */
-                if (zz > 0) /* up when hiding-under skips rest of pile */
+                if (zz < 0) /* up when hiding-under skips rest of pile */
                     continue;
             }
         }