create monster creating concealed mimic revisisted

commit 03d7d64d15:
| [...] but fixing this specific case is trivial.

Not trivial enough to avoid getting the details wrong.  An old
commit log message (58137a608a,
June of 2006) claimed that this was fixed for bag of tricks but
that was for monsters in general; mimics could still be wrong.
This commit is contained in:
PatR
2020-11-22 00:32:11 -08:00
parent efea46a93d
commit f43421ae3c
2 changed files with 14 additions and 9 deletions

View 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);