preserve dknown field between fakeobj instances

Preserve temporary fake object's previous dknown value by storing it
as a flag value within the m_ap_type field of the posing monster, and
recalling it when it is needed.

This is intended to help eliminate observable differences in price display
between real objects and mimics posing as objects.

98% of this is just switching the code to utilize macro M_AP_TYPE(mon)
everywhere to ensure that the flag bits are stripped off when needed.
This commit is contained in:
nhmall
2019-04-22 14:17:18 -04:00
parent cd6b5ef933
commit dcf4da2150
30 changed files with 127 additions and 115 deletions

View File

@@ -384,7 +384,7 @@ register struct obj *obj;
} else if (mtmp->mappearance) {
const char *what = "thing";
switch (mtmp->m_ap_type) {
switch (M_AP_TYPE(mtmp)) {
case M_AP_OBJECT:
what = simple_typename(mtmp->mappearance);
break;
@@ -486,7 +486,7 @@ struct obj *obj;
}
/* mimic must be revealed before we know whether it
actually moves because line-of-sight may change */
if (mtmp->m_ap_type)
if (M_AP_TYPE(mtmp))
seemimic(mtmp);
omx = mtmp->mx, omy = mtmp->my;
mnexto(mtmp);
@@ -2109,7 +2109,7 @@ long timeout;
and_vanish[0] = '\0';
if ((mtmp->minvis && !See_invisible)
|| (mtmp->data->mlet == S_MIMIC
&& mtmp->m_ap_type != M_AP_NOTHING))
&& M_AP_TYPE(mtmp) != M_AP_NOTHING))
suppress_see = TRUE;
if (mtmp->mundetected) {
@@ -2840,7 +2840,7 @@ struct obj *obj;
}
wakeup(mtmp, TRUE);
} else {
if (mtmp->m_ap_type && !Protection_from_shape_changers
if (M_AP_TYPE(mtmp) && !Protection_from_shape_changers
&& !sensemon(mtmp))
stumble_onto_mimic(mtmp);
else