]> granicus.if.org Git - nethack/commitdiff
Can't swallow trapped monsters
authorPasi Kallinen <paxed@alt.org>
Sat, 5 Mar 2022 16:30:30 +0000 (18:30 +0200)
committerPasi Kallinen <paxed@alt.org>
Sat, 5 Mar 2022 16:30:36 +0000 (18:30 +0200)
Gulping can move the trapped monster to another location, while
still being marked as trapped.  I don't want to deal with this,
so just say purple worms can't swallow trapped monsters...

src/mhitm.c

index f6c0bcbf676dc66396c35032a74bb346b534ceba..4d7c4957d72c616be79fc85ad2d4d2d1636654b0 100644 (file)
@@ -717,6 +717,10 @@ engulf_target(struct monst *magr, struct monst *mdef)
     if (mdef->data->msize >= MZ_HUGE)
         return FALSE;
 
+    /* can't swallow trapped monsters. TODO: could do some? */
+    if (mdef->mtrapped)
+        return FALSE;
+
     /* (hypothetical) engulfers who can pass through walls aren't
      limited by rock|trees|bars */
     if ((magr == &g.youmonst) ? Passes_walls : passes_walls(magr->data))