From 539c3307a6e8e795eb3218078c57c359f15250ad Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 6 Nov 2021 19:18:18 -0400 Subject: [PATCH] Fixed persistence error that would occur when dropping a modular item and then picking up that same item in the same persistence cycle. --- common/src/comp/inventory/item/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 8e0d88fce6..3778f9b1aa 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -758,6 +758,10 @@ impl Item { } else { self.item_id = Arc::new(AtomicCell::new(None)); } + // Reset item id for every component of an item too + for component in self.components.iter_mut() { + component.reset_item_id(); + } } /// Removes the unique identity of an item - used when dropping an item on