This issue is caused by the "Automatic Small-Items Collection - RR 2370"
patch ( https://rb.freedroid.org/r/2370 ) and only present when
automatic-collection is enabled.
reproduce:
- enable auto-collect (game options)
- then open inventory, pick up a normal item (e.g. some weapon)
- try place the weapon to a slot of an auto-collected item (e.g. a potion).
when swapping items: drop_held_item_to_inventory () -> MakeHeldFloorItemOutOf
() "item_held_in_hand" now points to a free entry in CURLEVEL()->ItemList[] ;
and not to an item in Me.Inventory[].
handle_automatic_item_collection () comes around and checks the Level's
ItemList, auto-collects the item (add to Me.inventory), and calls
raw_move_picked_up_item_to_entry() which clears the item in the Level-list and
sets type = -1. However, item_held_in_hand is not changed.
Now item_held_in_hand is not NULL and item_held_in_hand->type = -1 ; this causes
a crash later in src/hud.c when looking up
item_specs_get_name(item_held_in_hand->type) |