]> granicus.if.org Git - nethack/commitdiff
striking/force-bolt comment
authorPatR <rankin@nethack.org>
Mon, 2 Jan 2023 22:25:23 +0000 (14:25 -0800)
committerPatR <rankin@nethack.org>
Mon, 2 Jan 2023 22:25:23 +0000 (14:25 -0800)
I'm not sure whether newsym_force() is still necessary, but add a
comment about why it's being used in bhito().

src/zap.c

index 99b31b139e54b052ad5af95bd5eae8df8d6e82ea..18c872947f3e44b7d44e4268f799a128a3069f21 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -2137,14 +2137,16 @@ bhito(struct obj *obj, struct obj *otmp)
                         You_hear("a crumbling sound.");
                 }
             } else {
-                int oox = obj->ox;
-                int ooy = obj->oy;
-                if (gc.context.mon_moving
-                        ? !breaks(obj, obj->ox, obj->oy)
-                        : !hero_breaks(obj, obj->ox, obj->oy, 0))
+                int oox = obj->ox, ooy = obj->oy;
+
+                if (gc.context.mon_moving ? !breaks(obj, oox, ooy)
+                                          : !hero_breaks(obj, oox, ooy, 0))
                     maybelearnit = FALSE; /* nothing broke */
                 else
-                    newsym_force(oox,ooy);
+                    /* obj broke; force redisplay in case it was the only--
+                       or last--item under non-breaking pile-top; top item
+                       here might now be a lone object rather than a pile */
+                    newsym_force(oox, ooy);
                 res = 0;
             }
             if (maybelearnit)