From: PatR Date: Mon, 7 Mar 2022 23:12:12 +0000 (-0800) Subject: fix github issue #691 - non-lawful Angels \ X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0effaf529ad54820b70927c6f49b85da1c72e1f3;p=nethack fix github issue #691 - non-lawful Angels \ get lawful artifacts Reported by vultur-cadens, Angels can be given Sunsword or Demonbane for starting equipment even when they aren't lawful so won't attempt to use those. This should fix it but it's a pain to test. Closes #691 --- diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index d2a3a4413..e3d797e43 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.836 $ $NHDT-Date: 1646260985 2022/03/02 22:43:05 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.838 $ $NHDT-Date: 1646694720 2022/03/07 23:12:00 $ General Fixes and Modified Features ----------------------------------- @@ -833,6 +833,7 @@ clear obj->bypass for buried objects [a giant on ice triggers a fire trap, other inventory, ice is melted, boulder plugs resulting pool burying rest of giant's dropped inventory, subsequent sanity checks report that there are buried objects which are 'flagged bypass'] +only give Sunsword or Demonbane as starting gear to lawful Angels Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/makemon.c b/src/makemon.c index 0c4346c34..843415080 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 makemon.c $NHDT-Date: 1606033928 2020/11/22 08:32:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.180 $ */ +/* NetHack 3.7 makemon.c $NHDT-Date: 1646694721 2022/03/07 23:12:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.199 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -324,7 +324,9 @@ m_initweap(register struct monst *mtmp) otmp = mksobj(LONG_SWORD, FALSE, FALSE); /* maybe make it special */ - if (!rn2(20) || is_lord(ptr)) + if ((!rn2(20) || is_lord(ptr)) + && sgn(mtmp->isminion ? EMIN(mtmp)->min_align + : ptr->maligntyp) == A_LAWFUL) otmp = oname(otmp, artiname(rn2(2) ? ART_DEMONBANE : ART_SUNSWORD), ONAME_NO_FLAGS);