]> granicus.if.org Git - nethack/commitdiff
create monster creating concealed mimic revisisted
authorPatR <rankin@nethack.org>
Sun, 22 Nov 2020 08:32:11 +0000 (00:32 -0800)
committerPatR <rankin@nethack.org>
Sun, 22 Nov 2020 08:32:11 +0000 (00:32 -0800)
commit 03d7d64d1556919cbeb830befb2db7d4be4899db:
| [...] but fixing this specific case is trivial.

Not trivial enough to avoid getting the details wrong.  An old
commit log message (58137a608acf418700dd527bc69b2ad5a198495d,
June of 2006) claimed that this was fixed for bag of tricks but
that was for monsters in general; mimics could still be wrong.

doc/fixes37.0
src/makemon.c

index 1d1f74d7f75c43808b92155bcd371aa8f4fd8853..19f8eeb9367a3c9152e05fa5da6b1d2683bff622 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.360 $ $NHDT-Date: 1606011660 2020/11/22 02:21:00 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.361 $ $NHDT-Date: 1606033928 2020/11/22 08:32:08 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -300,9 +300,9 @@ since ki-rin look quite a bit like unicorns, make them be more like one:
        allow them to use their own horn to cure themselves; remove M1_ANIMAL,
        change MS_NEIGH to MS_SPELL, add MR_POISON, use horse body parts;
        they're still 'A' rather than 'u' and don't care about gems
-wand or scroll of create monster that makes a new monster which can be seen
-       or sensed becomes discovered but was doing so even for a concealed
-       mimic seen as furniture or an object
+wand/scroll of create monster or bag of tricks that makes a new monster which
+       can be seen or sensed becomes discovered, but was doing so even for a
+       concealed mimic seen as furniture or an object
 'showscore' could be used to determine how much gold was inside a container
        whose contents were unknown
 
index 67cc8345212b957d2b2dee3f545b12e8df89ca40..11725b94ccc3ce21412b6e5c5f865d516d692d71 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 makemon.c       $NHDT-Date: 1605927392 2020/11/21 02:56:32 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.179 $ */
+/* NetHack 3.7 makemon.c       $NHDT-Date: 1606033928 2020/11/22 08:32:08 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.180 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2012. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1502,9 +1502,12 @@ boolean neverask;
         if (!mptr && u.uinwater && enexto(&c, x, y, &mons[PM_GIANT_EEL]))
             x = c.x, y = c.y;
 
-        mon = makemon(mptr, x, y, NO_MM_FLAGS);
-        if (mon && canspotmon(mon) && (M_AP_TYPE(mon) == M_AP_NOTHING
-                                       || M_AP_TYPE(mon) == M_AP_MONSTER))
+        if ((mon = makemon(mptr, x, y, NO_MM_FLAGS)) == 0)
+            continue; /* try again [should probably stop instead] */
+
+        if ((canseemon(mon) && (M_AP_TYPE(mon) == M_AP_NOTHING
+                                || M_AP_TYPE(mon) == M_AP_MONSTER))
+            || sensemon(mon))
             known = TRUE;
     }
     return known;
@@ -2360,7 +2363,9 @@ int *seencount;  /* secondary output */
             mtmp = makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);
             if (mtmp) {
                 ++moncount;
-                if (canspotmon(mtmp))
+                if ((canseemon(mtmp) && (M_AP_TYPE(mtmp) == M_AP_NOTHING
+                                         || M_AP_TYPE(mtmp) == M_AP_MONSTER))
+                    || sensemon(mtmp))
                     ++seecount;
             }
         } while (--creatcnt > 0);