]> granicus.if.org Git - nethack/commitdiff
Monsters never try to pick up ball or chain
authorPasi Kallinen <paxed@alt.org>
Wed, 1 Feb 2023 19:38:26 +0000 (21:38 +0200)
committerPasi Kallinen <paxed@alt.org>
Wed, 1 Feb 2023 19:43:26 +0000 (21:43 +0200)
Apparently my m_move reorg made it possible for monsters to
pick up the chain attached to hero; explicitly prevent that.

src/monmove.c

index 0e70a2c62ee7031493f729db1d2e9dc9ef8a8d67..ee087099a2fe11f75cc4ae2d333912b1778ec565 100644 (file)
@@ -849,6 +849,8 @@ mon_would_take_item(struct monst *mtmp, struct obj *otmp)
 {
     int pctload = (curr_mon_load(mtmp) * 100) / max_mon_load(mtmp);
 
+    if (otmp == uball || otmp == uchain)
+        return FALSE;
     if (is_unicorn(mtmp->data) && objects[otmp->otyp].oc_material != GEMSTONE)
         return FALSE;
     if (!mindless(mtmp->data) && !is_animal(mtmp->data) && pctload < 75