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.
10 KiB
10 KiB