angband
angband copied to clipboard
Thrown items in quiver: changing inscriptions can trigger pack overflow
With a full pack, a dagger inscribed with '@v1' so it is in the quiver, and no stack in the pack that could either take the dagger's place in the quiver or absorb the dagger, changing the inscription on the dagger so it no longer goes to the quiver will trigger a pack overflow the next time the pack is combined.
Thinking about that leads me to three possible issues:
- It would seem to open a very minor hole that a player could exploit: remove the inscription on the dagger to drop it without spending a turn.
- For a change to the inscriptions from autoinscribe_pack() or equivalent, there's the potential that more than one stack has its inscription changed and would be evicted from the quiver when the pack is combined: leading to a case that pack_overflow() isn't prepared to handle.
- If one tries to add code to more cleanly handle the overflow (call pack_overflow() immediately after any inscription change which might rearrange the quiver and prefer to drop the item whose inscription changed), what happens when the inscription change happens while in a store? As it stands, without the addition of any new overflow handling, changing the inscription on the dagger while in a store is relatively benign: combining the pack happens after exiting the store and the dagger drops next to the store entrance.
I'm inclined to leave it as is for now, but leave this issue open as a reminder.