Qt misuse of Role_if()

The Qt paper doll highlights known blessed/uncursed/cursed items with
a color border.  It was trying to force obj->bknown for non-blinded
priest[ess] but passed the old role letter argument to Role_if()
instead of the monster number that's used these days.  It was also
potentially modifying an invent item in a way that's observable to
the player but not updating persistent inventory to show that.

Probably didn't matter though; I don't think the situation it checks
for can occur anymore.  On the off chance that it could, move the
check-and-set out of #if ENHANCED_PAPERDOLL so that same inventory
update would occur for ordinary paper doll even though that doesn't
care about displayed items' bless/curse state.
This commit is contained in:
PatR
2021-12-27 14:27:35 -08:00
parent 8b30f3e1d1
commit 43317a2ef7
2 changed files with 8 additions and 3 deletions

View File

@@ -2331,7 +2331,7 @@ learn_unseen_invent(void)
return; /* sanity check */
for (otmp = g.invent; otmp; otmp = otmp->nobj) {
if (otmp->dknown)
if (otmp->dknown && (otmp->bknown || !Role_if(PM_CLERIC)))
continue; /* already seen */
/* set dknown, perhaps bknown (for priest[ess]) */
(void) xname(otmp);