\#wizidentify bug - 'Not carrying anything.'

when carrying things.  The fuzzer toggled on 'perm_invent' and after
interrupting it I used ^I.  Having 'perm_invent' enabled makes the
inventory code avoid having a totally empty inventory display (by
supplying "Not carrying anything" instead--in the menu rather than
via normal pline) so that interface code will see a change and know
that an update is needed.  But to decide whether the menu was empty,
the inventory code was testing union 'any' field 'a_char' to check
whether some item had used the union (implying that something had
been passed to add_menu()), but wizidentify (^I) uses field 'a_obj'
instead.  Apparently the a_char bits stayed 0 because the menu ended
up with "Not carrying anything" after a list of inventory items.
Switch to a separate variable to track whether anything has been put
into the menu instead of trying to rely on the union.

Unrelated but noticed when checking other "Not carrying anything"
instances, the #adjust command ends early when there's no inventory
but it was asking for a letter to adjust even when the only thing in
inventory was gold in '$' slot, which isn't allowed to be adjusted
away from that slot.  Treat gold-only like no-invent.
This commit is contained in:
PatR
2019-06-23 11:31:21 -07:00
parent c968f03af3
commit 83410a3d4f
2 changed files with 20 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.64 $ $NHDT-Date: 1561233801 2019/06/22 20:03:21 $
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.65 $ $NHDT-Date: 1561314651 2019/06/23 18:30:51 $
This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -84,6 +84,9 @@ partly eaten food with one bite left had message anomalies when eaten; the
usual "you resume your meal" case lacked the "you're finished" message
when done; eating something else in between to clobber meal context
resulted in no messages at all when restarting and finishing last bite
wizard mode ^I menu could list "Not carrying anything" after inventory items
if perm_invent option was On (even on tty where that's not supported)
change #adjust to treat carrying only gold as not having anything to adjust
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository