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

@@ -377,7 +377,7 @@ int sightflags; /* 1 if the monster is physically seen;
2 if detected using Detect_monsters */
xchar worm_tail; /* mon is actually a worm tail */
{
boolean mon_mimic = (mon->m_ap_type != M_AP_NOTHING);
boolean mon_mimic = (M_AP_TYPE(mon) != M_AP_NOTHING);
int sensed = (mon_mimic && (Protection_from_shape_changers
|| sensemon(mon)));
/*
@@ -388,7 +388,7 @@ xchar worm_tail; /* mon is actually a worm tail */
*/
if (mon_mimic && (sightflags == PHYSICALLY_SEEN)) {
switch (mon->m_ap_type) {
switch (M_AP_TYPE(mon)) {
default:
impossible("display_monster: bad m_ap_type value [ = %d ]",
(int) mon->m_ap_type);