Commit 024abf7
Fix inventory overflow bug overwriting equipment slot 0
FindFirstFreeSlotThatFitsItem was returning 0 instead of INVALID_INDEX
when no free slot was found. This caused items to be placed in slot 0
(charm equipment slot) when inventory was full, overwriting equipped items.
Changes:
- Fix FindFirstFreeSlotThatFitsItem to return INVALID_INDEX when no slot found
- Add defensive check in PutItemInInventoryWithStacking to protect equipment
slots 0-22 from being targeted for item placement1 parent 9d2cc21 commit 024abf7
2 files changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1839 | 1839 | | |
1840 | 1840 | | |
1841 | 1841 | | |
1842 | | - | |
| 1842 | + | |
1843 | 1843 | | |
1844 | 1844 | | |
1845 | 1845 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4679 | 4679 | | |
4680 | 4680 | | |
4681 | 4681 | | |
4682 | | - | |
| 4682 | + | |
| 4683 | + | |
4683 | 4684 | | |
4684 | 4685 | | |
4685 | 4686 | | |
| |||
0 commit comments