Clamp pouch inventory per satchel size

Closes #3384
This commit is contained in:
Kurt 2022-02-04 22:18:57 -08:00
parent cb92166aa2
commit e2bafab3c2
2 changed files with 6 additions and 3 deletions

View File

@ -18,7 +18,10 @@ public override IReadOnlyList<InventoryPouch> Inventory
get
{
var access = ((SAV8LA)SAV).Accessor;
var regular = new InventoryPouch8a(InventoryType.Items, Legal.Pouch_Items_LA , 999, 675);
var satchel = (uint)access.GetBlock(SaveBlockAccessor8LA.KSatchelUpgrades).GetValue();
var regularSize = (int)Math.Min(675, satchel);
var regular = new InventoryPouch8a(InventoryType.Items, Legal.Pouch_Items_LA , 999, regularSize);
var key = new InventoryPouch8a(InventoryType.KeyItems, Legal.Pouch_Key_LA , 1, 100);
var stored = new InventoryPouch8a(InventoryType.PCItems, Legal.Pouch_Items_LA , 999, 180);
var recipe = new InventoryPouch8a(InventoryType.Treasure, Legal.Pouch_Recipe_LA, 1, 70);

View File

@ -22,8 +22,8 @@ public override void GetPouch(ReadOnlySpan<byte> data)
{
var items = new InventoryItem8a[MaxSize];
for (int i = 0; i < data.Length; i += 4)
items[i/4] = GetItem(data, i);
for (int i = 0; i < items.Length; i++)
items[i] = GetItem(data, i << 2);
Items = items;
}