From 37c7fbe8d010f77e5f60b731bb250a94206179c8 Mon Sep 17 00:00:00 2001 From: neru Date: Thu, 18 Jun 2026 17:59:24 -0300 Subject: [PATCH] fix: add more validation to item dumper --- src/dumper/dumper.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dumper/dumper.cs b/src/dumper/dumper.cs index 1251e34..2d5b906 100644 --- a/src/dumper/dumper.cs +++ b/src/dumper/dumper.cs @@ -190,14 +190,18 @@ class Dumper string itemId = row.Key.Text; - if (!TryGetProp(props, "Type", out EInventoryItemType itemType) || !TryGetProp(props, "UIData", out FStructFallback uiDataFb)) - throw new KeyNotFoundException("Type or UIData was not found."); + if (!TryGetProp(props, "Type", out EInventoryItemType itemType) + || !TryGetProp(props, "UIData", out FStructFallback uiDataFb) + || !TryGetProp(props, "Role", out EPlayerRole role) + || !TryGetProp(props, "Inventory", out bool isInventory)) + throw new KeyNotFoundException("Type, UIData or Role was not found."); UIDataStruct uiData = uiDataFb.MapToStruct(); - if (itemType != EInventoryItemType.Item) + // ignore powers, slasher and challenge related items + if (!isInventory || itemType != EInventoryItemType.Item || role != EPlayerRole.VE_Camper) { - _log.Verbose("Ignoring invalid item type ({0})", itemType.ToString()); + _log.Verbose("Ignoring invalid item ({0})", itemId); continue; }