don't require Stackable base type for stacking logic

This commit is contained in:
Tyfon
2024-07-19 12:54:51 -07:00
parent fea43bcada
commit e19cf80c35
5 changed files with 32 additions and 41 deletions

View File

@@ -119,7 +119,6 @@ public static class SortPatches
{
Error error = null;
var mergeableItems = lootItem.Grids.SelectMany(g => g.Items)
.OfType<Stackable>()
.Where(i => i.StackObjectsCount < i.StackMaxSize)
.ToArray();
@@ -131,7 +130,7 @@ public static class SortPatches
continue;
}
if (InteractionsHandlerClass.smethod_0(lootItem.Grids, item, out Stackable targetItem, 1))
if (Sorter.FindStackForMerge(lootItem.Grids, item, out Item targetItem, 1))
{
var operation = InteractionsHandlerClass.TransferOrMerge(item, targetItem, inventoryController, true);
if (operation.Succeeded)