altar color revisited

The issue of mimics masquerading as altars just came up two weeks
ago but never entered my mind when I worked on this yesterday.
This commit is contained in:
PatR
2019-12-08 10:36:52 -08:00
parent 625bfd1efd
commit d43f8f6f9e
4 changed files with 33 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pray.c $NHDT-Date: 1575755077 2019/12/07 21:44:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.133 $ */
/* NetHack 3.6 pray.c $NHDT-Date: 1575830189 2019/12/08 18:36:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.134 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2077,6 +2077,24 @@ doturn()
return 1;
}
int
altarmask_at(x, y)
int x, y;
{
int res = 0;
if (isok(x, y)) {
struct monst *mon = m_at(x, y);
if (mon && M_AP_TYPE(mon) == M_AP_FURNITURE
&& mon->mappearance == S_altar)
res = has_mcorpsenm(mon) ? MCORPSENM(mon) : 0;
else if (IS_ALTAR(levl[x][y].typ))
res = levl[x][y].altarmask;
}
return res;
}
const char *
a_gname()
{