From: PatR Date: Sun, 13 Dec 2020 23:51:23 +0000 (-0800) Subject: bargethrough/monster-vs-monster displacing X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e9d729733b709838612015936232c4bafbe4de65;p=nethack bargethrough/monster-vs-monster displacing Fix the regression that monster movement flag unification introduced for monsters able to swap places with adjacent monsters. It used to be restricted in order to prevent Riders swapping places with other Riders so that they didn't repeatedly exchange places when one was right behind the other and the farther one moved first. Then when displacer beasts were added, that restriction was extended to prevent them swapping places with Riders (but not the other way around.) The flags change inadvertently let any displacer swap with any other displacer. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 2ead283a6..5dc248646 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.390 $ $NHDT-Date: 1607895902 2020/12/13 21:45:02 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.391 $ $NHDT-Date: 1607901923 2020/12/13 23:25:23 $ General Fixes and Modified Features ----------------------------------- @@ -432,6 +432,7 @@ dwarves could sometimes pass through walls without digging their way fix genetic engineers dropping Schroedinger's cat box the checks and handling for fountains, sinks, and drawbridges were being missed during liquid_flow +monster movement flags unification allowed displacer beasts to displace Riders curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/src/mon.c b/src/mon.c index 06a00a4a3..ad126c6c5 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mon.c $NHDT-Date: 1607374002 2020/12/07 20:46:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.359 $ */ +/* NetHack 3.7 mon.c $NHDT-Date: 1607901923 2020/12/13 23:25:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.360 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1586,8 +1586,10 @@ struct monst *mtmp; allowflags |= UNLOCKDOOR; if (passes_bars(mtmp->data)) allowflags |= ALLOW_BARS; +#if 0 /* can't do this here; leave it for mfndpos() */ if (is_displacer(mtmp->data)) allowflags |= ALLOW_MDISP; +#endif if (is_minion(mtmp->data) || is_rider(mtmp->data)) allowflags |= ALLOW_SANCT; /* unicorn may not be able to avoid hero on a noteleport level */ @@ -1712,7 +1714,7 @@ long flag; || (m_at(x, ny) && m_at(nx, y) && worm_cross(x, y, nx, ny) && !m_at(nx, ny) && (nx != u.ux || ny != u.uy)))) continue; - if ((is_pool(nx, ny) == wantpool || poolok) + if ((poolok || is_pool(nx, ny) == wantpool) && (lavaok || !is_lava(nx, ny))) { int dispx, dispy; boolean monseeu = (mon->mcansee @@ -1764,6 +1766,7 @@ long flag; info[cnt] |= ALLOW_TM; } } else { + flag &= ~ALLOW_MDISP; /* depends upon defender */ mmflag = flag | mm_displacement(mon, mtmp2); if (!(mmflag & ALLOW_MDISP)) continue;