fix github issue #1192 - engulfers vs iron bars
Issue reported by Umbire: an engulfing monster capable of passing through iron bars (vortices and air elemental) could do so while carrying the hero. Prevent an engulfer from doing that unless the hero happens to be polymorphed into a subset of the types of monsters that can move to iron bar locations. Fixes #1192
This commit is contained in:
@@ -1873,7 +1873,11 @@ mon_allowflags(struct monst* mtmp)
|
||||
allowflags |= OPENDOOR;
|
||||
if (can_unlock)
|
||||
allowflags |= UNLOCKDOOR;
|
||||
if (passes_bars(mtmp->data))
|
||||
if (passes_bars(mtmp->data)
|
||||
/* restrict engulfer or holder who might try to pass iron bars while
|
||||
carrying hero; accept small subset for poly'd hero passes_bars() */
|
||||
&& (mtmp != u.ustuck || (unsolid(gy.youmonst.data)
|
||||
|| verysmall(gy.youmonst.data))))
|
||||
allowflags |= ALLOW_BARS;
|
||||
#if 0 /* can't do this here; leave it for mfndpos() */
|
||||
if (is_displacer(mtmp->data))
|
||||
|
||||
Reference in New Issue
Block a user