From c0df46f9f8f393576ccf224cf75f45537a19f1ab Mon Sep 17 00:00:00 2001 From: Michal Pikulski Date: Fri, 12 Sep 2025 13:24:04 +0200 Subject: [PATCH] Update dispatchers and message for slotting items --- Assets/Scripts/Interactions/ItemSlot.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Interactions/ItemSlot.cs b/Assets/Scripts/Interactions/ItemSlot.cs index 898ab082..e86ac95c 100644 --- a/Assets/Scripts/Interactions/ItemSlot.cs +++ b/Assets/Scripts/Interactions/ItemSlot.cs @@ -129,14 +129,22 @@ namespace Interactions var allowed = config?.allowedItems ?? new List(); if (allowed.Contains(itemToSlotData)) { - DebugUIMessage.Show("You correctly slotted " + itemToSlotData.itemName + " into: " + itemData.itemName, Color.green); - onCorrectItemSlotted?.Invoke(); + if (itemToSlot != null) + { + DebugUIMessage.Show("You correctly slotted " + itemToSlotData.itemName + " into: " + itemData.itemName, Color.green); + onCorrectItemSlotted?.Invoke(); + } + Interactable.BroadcastInteractionComplete(true); } else { - DebugUIMessage.Show("I'm not sure this works.", Color.yellow); - onIncorrectItemSlotted?.Invoke(); + + if (itemToSlot != null) + { + DebugUIMessage.Show("I'm not sure this works.", Color.yellow); + onIncorrectItemSlotted?.Invoke(); + } Interactable.BroadcastInteractionComplete(false); } }