From: PatR Date: Wed, 23 Feb 2022 17:50:25 +0000 (-0800) Subject: fix #K3529 - perm_invent not IDing blank scroll X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2635c60280476e70b45a9f73a6c95c08664164ac;p=nethack fix #K3529 - perm_invent not IDing blank scroll Report was for curses but issue is in the core so any interface that supports persistent inventory is affected. Reading a not-yet- discovered scroll of blank paper wasn't always updating perm_invent to show change in formatted description when it became discovered. Would only happen on turn #1 (so the scroll needed to be acquired via autopickup at starting location or via wizard mode wish so that it could be read before any game time elapsed) when the object discovery routine deliberately avoided updating perm_invent. Fix by using a different way than moves==1 to decide whether an object is being discovered because it is part of hero's initial inventory. --- diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index a7f94ed94..c67d7ae34 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -814,6 +814,10 @@ give a message when a trapped monster frees itself from some trap change kitchen sink glyph to a white { killed wood golem has a chance to also drop small shields, clubs, elven spears, and boomerangs +discovering an object on first turn with persistent inventory enabled might + not update inventory info for that item (autopickup a blank scroll + or spellbook and read it as first action; it becomes discovered but + will still be shown as if undiscovered until next inventory update) Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/o_init.c b/src/o_init.c index 8a4a72b30..6ad5fe0d0 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -444,8 +444,8 @@ discover_object(int oindx, boolean mark_as_known, boolean credit_hero) if (credit_hero) exercise(A_WIS, TRUE); } - /* moves==1L => initial inventory, gameover => final disclosure */ - if (g.moves > 1L && !g.program_state.gameover) { + /* !in_moveloop => initial inventory, gameover => final disclosure */ + if (g.program_state.in_moveloop && !g.program_state.gameover) { if (objects[oindx].oc_class == GEM_CLASS) gem_learned(oindx); /* could affect price of unpaid gems */ update_inventory();