fixed error where itemlocation can be either a string or int

This commit is contained in:
Chris Adamson
2025-04-28 12:07:46 -05:00
parent f9f44d47ee
commit 7ed081d305
3 changed files with 101 additions and 21 deletions
@@ -842,15 +842,8 @@ public class InventoryHelper(
// Check each item in container
foreach (var item in containerItemHash)
{
ItemLocation? itemLocation;
if (item.Location is JsonElement)
{
itemLocation = ((JsonElement) item.Location).ToObject<ItemLocation>();
}
else
{
itemLocation = (ItemLocation) item.Location;
}
var (itemLocation, _) = ItemHelper.TryParseItemLocation(item);
if (itemLocation is null)
{