Update GameInventoryItem (#2219)

* Update GameInventoryItem

- Resolve symbolic InventoryItem, used in HandIn
- Harden Materia/MateriaGrade/Stains results
- Make sure GameInventoryItem is constructed correctly

* Remove some duplicate code from InventoryWidget

* Fix null check
This commit is contained in:
Haselnussbomber 2025-03-28 17:00:14 +01:00 committed by GitHub
parent f5b3d85066
commit 6160252418
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 145 additions and 89 deletions

View file

@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@ -121,6 +121,8 @@ internal class GameInventory : IInternalDisposableService
// Assumption: newItems is sorted by slots, and the last item has the highest slot number.
var oldItems = this.inventoryItems[i] ??= new GameInventoryItem[newItems[^1].InternalItem.Slot + 1];
if (this.inventoryItems[i] == null)
oldItems.Initialize();
foreach (ref readonly var newItem in newItems)
{