]> granicus.if.org Git - nethack/commitdiff
Fix ball bypass sanity complaint
authorPasi Kallinen <paxed@alt.org>
Thu, 26 Aug 2021 15:46:22 +0000 (18:46 +0300)
committerPasi Kallinen <paxed@alt.org>
Thu, 26 Aug 2021 15:46:25 +0000 (18:46 +0300)
Be punished, get swallowed, drop the ball inside the monster
via the 'D' drop, kill the swallower - this issued a sanity
check complaint about the ball bypass flag.

In this case, the ball was "floating", not on any object chain,
when dropped inside the monster, so clear_bypasses didn't
clear the flag.

src/worn.c

index 1a04fb066e74c7bc5010f4fa5a18ade345787c6b..0cd4fab2193777fe1370c40f8c6b2a278b20d051 100644 (file)
@@ -839,6 +839,11 @@ clear_bypasses(void)
         /* no MCORPSENM(mtmp)==PM_LONG_WORM check here; long worms can't
            be just created by polymorph and migrating at the same time */
     }
+
+    /* ball can be "floating", not on any chain */
+    if (uball)
+        uball->bypass = 0;
+
     /* g.billobjs and g.mydogs chains don't matter here */
     g.context.bypasses = FALSE;
 }