Files
EscapistsReintroduced/docs/inventory-identity.md
T

2.0 KiB

Physical inventory identity

Native run logs_2026-09-19_06-39-49 returned repeated IEntity references for watches and the player's personal belongings. The repeated records had the same native entity address/ID; this was enumeration duplication, not extra physical stock. Installed InventoryStorageManagerComponent.GetItems documents returning items from all managed storages and does not promise unique references.

ERR_Inventory.Items now collects live unique entity references in first-seen order. AppendUnique also merges several inventories into an initially unique destination. Mortar battery totals count each physical shell once across crew inventories; initial equipment uses that same count; donor selection attempts each physical shell at most once per supply call. Distinct entities with the same prefab remain separate ammunition. The existing one-time nine-shell equipment target, real native moves, and finite-stock/depletion policy remain unchanged. Presence-only HQ radio checks remain unchanged.

Discovery folder searches also deduplicate their initial Intel result before merging objective documents. Duplicate FindItems results have not been demonstrated in the native run; this preserves the collector's physical-identity contract and prevents repeated processing if that API returns them.

tests/test_inventory_enumeration_policy.py executes the actual helper and mortar inventory-count bodies after mechanical translation with synthetic C++ entities. It covers repeated references, distinct shells sharing a prefab, null references, missing prefab data, cross-inventory overlap, ordering, and unchanged native input. This is a source-policy regression, not an Enforce compiler or inventory engine test. Native validation should rerun the existing companion mortar case: exactly 27 physical shells at startup, then physical deletion and sustained zero shells with zero fabricated shots. Core/Chat full-loop fixtures should count unique cache stock and distinct objective documents.