Fix not all armoury items being discarded

master v4.5
Liza 2024-01-25 09:47:46 +01:00
parent 5db9c5e6fb
commit 24b76b1b49
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<Version>4.4</Version>
<Version>4.5</Version>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

View File

@ -82,13 +82,14 @@ internal sealed class InventoryUtils
private unsafe IEnumerable<ItemWrapper> GetArmouryItemsToDiscard(bool condition, InventoryManager* inventoryManager,
InventoryType[] inventoryTypes, Dictionary<uint, uint> itemCounts, List<uint>? gearsetItems)
{
List<ItemWrapper> items = new();
if (condition)
{
foreach (InventoryType inventoryType in inventoryTypes)
return GetItemsToDiscard(inventoryManager, inventoryType, itemCounts, gearsetItems);
items.AddRange(GetItemsToDiscard(inventoryManager, inventoryType, itemCounts, gearsetItems));
}
return new List<ItemWrapper>();
return items;
}
public unsafe InventoryItem* GetNextItemToDiscard(ItemFilter? itemFilter)