diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 3c03571b1..baf99f84a 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1907,6 +1907,10 @@ if hero was wielding potion(s) of unholy water and a magic trap gave its remove curse effect, scroll of remove curse would become discovered object discoveries during the tutorial carried over when normal play resumed; counts of monsters created and vanquished carried over too +end-of-game attribute disclosure in wizard mode reported incorrect text for + for apron/alchemy smock's conferral of poison+acid resistances + (3.6.x was susceptible to this for T-shirt text but since T-shirts + don't confer any attributes, it wasn't noticeable) Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository diff --git a/src/objnam.c b/src/objnam.c index b2422de54..747c261dc 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -928,8 +928,17 @@ xname_flags( releaseobuf(obufp); } - /* maybe give some extra information which isn't shown during play */ - if (gp.program_state.gameover && bufspaceleft > 0) { + /* give some extra information when game is over; for end-of-game + attribute disclosure in wizard mode, ysimple_name() calls + minimal_xname() which passes us a dummy object with o_id==0; + tshirt_text(), apron_text(), and so forth base their result on + o_id and would give inconsistent information compared to what + just got shown for inventory disclosure; fortunately, we want to + avoid the 'with text' part of + "You were acid resistant because of your alchemy smock \ + with text \"Kiss the cook\"." + when disclosing attributes anyway */ + if (gp.program_state.gameover && obj->o_id && bufspaceleft > 0) { const char *lbl; char tmpbuf[BUFSZ]; @@ -1033,9 +1042,9 @@ minimal_xname(struct obj *obj) if (obj->otyp == SLIME_MOLD) bareobj.spe = obj->spe; - /* bufp will be an obuf[] and a pointer into middle of that is viable */ bufp = distant_name(&bareobj, xname); - /* undo forced setting of bareobj.blessed for cleric (preist[ess]) */ + /* undo forced setting of bareobj.blessed for cleric (preist[ess]); + bufp is an obuf[] so a pointer into the middle of that is viable */ if (!strncmp(bufp, "uncursed ", 9)) bufp += 9;