From: Pasi Kallinen Date: Sat, 5 Mar 2022 16:30:30 +0000 (+0200) Subject: Can't swallow trapped monsters X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=785463ba31f2f29d29f7b23c2499fda5d8f4d9ce;p=nethack Can't swallow trapped monsters 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... --- diff --git a/src/mhitm.c b/src/mhitm.c index f6c0bcbf6..4d7c4957d 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -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))