]> granicus.if.org Git - nethack/commitdiff
fix github issue #691 - non-lawful Angels \
authorPatR <rankin@nethack.org>
Mon, 7 Mar 2022 23:12:12 +0000 (15:12 -0800)
committerPatR <rankin@nethack.org>
Mon, 7 Mar 2022 23:12:12 +0000 (15:12 -0800)
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

doc/fixes3-7-0.txt
src/makemon.c

index d2a3a4413497fa210dd3ef3bb6f40019ab84f77a..e3d797e43c3452f2f9eb4d762eed556cd885035c 100644 (file)
@@ -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
index 0c4346c3488fefe24b340e2ffeab1803be12bf30..84341508007b62e29d56c0fc17f387f632be7ee0 100644 (file)
@@ -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);