diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 0f1e1c4a0..513d975d9 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1743,6 +1743,9 @@ if recoil from throwing an item while levitating sent hero into a wall of include '-' as suggested item in "what to dip?" prompt if dipping at pool or fountain or sink with slippery hands don't attempt a second hit for bare handed/martial arts if wearing a shield +when using 'm #overview' to annotate a level other than current the one, + include level number, and dungeon branch if not current one, in the + prompt instead of generic "this level" Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository diff --git a/src/dungeon.c b/src/dungeon.c index 3495c8e1b..52e04329a 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -2650,7 +2650,29 @@ query_annotation(d_level *lev) getlin(tmpbuf, nbuf); } else #endif - getlin("What do you want to call this dungeon level?", nbuf); + { + char qbuf[QBUFSZ], lbuf[QBUFSZ]; /* level description */ + + if (!lev || on_level(&u.uz, lev)) { + Strcpy(lbuf, "this dungeon level"); + } else { + int dflgs = (lev->dnum == u.uz.dnum) ? 0 : 2; + d_level save_uz = u.uz; + + u.uz = *lev; + (void) describe_level(lbuf, dflgs); + u.uz = save_uz; + + (void) strsubst(lbuf, "Dlvl:", "level "); + /* even though we've told describe_level() not to append + a trailing space (by not including '1' in dflgs), the + level number is formatted with %-2d so single digit + values will end up with one anyway; remove it */ + (void) trimspaces(lbuf); + } + Snprintf(qbuf, sizeof qbuf, "What do you want to call %s?", lbuf); + getlin(qbuf, nbuf); + } /* empty input or ESC means don't add or change annotation; space-only means discard current annotation without adding new one */