Extract the shared preserved-note mapping into GetOtherNaKrulNotes.
Keep the ground pickup and inserted-inventory entry points separate because they still have different item lifetime and inventory compaction semantics.
Keep Na-Krul note auto-combine limited to player-facing inventory inserts so internal inventory reflow does not trigger partial side effects.\n\nTrack the inserted note through inventory compaction when combining, and add inventory regression tests for duplicate notes and sort behavior.
Fixes#8487
Torn notes were only combined when picked up from the ground via
CheckQuestItem(). When notes entered the inventory through other
paths (e.g. stash transfers, item swaps), the combine logic never
ran.
Add CheckSpecialInventoryItem() which checks whether all three torn
notes are present after an item is placed into InvList, and combines
them into the full note if so.
Called from:
- ChangeInvItem (empty slot path)
- ChangeInvItem (swap path)
- AutoPlaceItemInInventory (covers stash-to-inventory transfers)
* Shift item order when selling instead of using last item to fill the slot
Player has items i1, i2, i3, picked up in that order.
Previous Behavior:
1. Sell window at vendor shows i1, i2, i3.
2. Player sells i1
3. i3 is last in list and replaces i1
4. Sell window now shows i3, i2.
New Behavior:
1. Sell window at vendor shows i1, i2, i3.
2. Player sells i1
3. i2/i3 are shifted in index position down to fill the gap left by previous index.
4. Sell window now shows i2, i3.
* Remove whitespace
In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.
This will be needed for #7638, which will statically initialize change
handlers after the Options object has been initialized.
Fix a bug that caused two-handed items not to able to be equipped
if there was an item in the right hand, but not in the left one
and also there wasn't enough space to place the right item TWO times.
This was unintended, obviously, the right item should only be checked for once.
Co-authored-by: Tully <166401925+Tully-B@users.noreply.github.com>
4 options args are a bit unwieldy, especially when you want
to pass only the first and the last one.
With a struct, there is no need to specify the default values
for the args in between.