From 942f2af263aa0d9e7f50b8868dd2a2b437b95eae Mon Sep 17 00:00:00 2001 From: Gene Date: Thu, 5 Jun 2025 14:43:30 -0700 Subject: [PATCH] Low impact fix for possible zombie items from MakePermanent action --- Assets/Scripts/Game/Questing/Item.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Game/Questing/Item.cs b/Assets/Scripts/Game/Questing/Item.cs index 65a243a838..46dc2e18fc 100644 --- a/Assets/Scripts/Game/Questing/Item.cs +++ b/Assets/Scripts/Game/Questing/Item.cs @@ -5,7 +5,7 @@ // Source Code: https://github.com/Interkarma/daggerfall-unity // Original Author: Lypyl (lypyldf@gmail.com), Gavin Clayton (interkarma@dfworkshop.net) // Contributors: Hazelnut -// +// // Notes: // @@ -19,7 +19,7 @@ using DaggerfallWorkshop.Game.Guilds; /*Example patterns: - * + * * Item _gold_ gold * Item _gold1_ gold range 5 to 25 * Item talisman talisman @@ -281,8 +281,19 @@ public void MakePermanent() madePermanent = true; // Set current DaggerfallUnityItem instance as permanent - if (DaggerfallUnityItem != null) - DaggerfallUnityItem.MakePermanent(); + if (item != null) + item.MakePermanent(); + + // Make sure permanency is synced for items in player item collections + Entity.PlayerEntity playerEntity = GameManager.Instance.PlayerEntity; + DaggerfallUnityItem[] items = playerEntity.Items.ExportQuestItems(ParentQuest.UID, Symbol); + if (items == null || items.Length == 0) + return; + + foreach (DaggerfallUnityItem dfitem in items) + { + dfitem.MakePermanent(); + } } #endregion