From 82c2c7f23cb33fc7a5f9c6d90cd95be7c37e8569 Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Sat, 30 Aug 2025 20:39:46 +0100 Subject: [PATCH] Reattempt set slot after filter fail (#403) --- exp_legacy/module/modules/control/vlayer.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exp_legacy/module/modules/control/vlayer.lua b/exp_legacy/module/modules/control/vlayer.lua index 4e7e17a1..fd32a966 100644 --- a/exp_legacy/module/modules/control/vlayer.lua +++ b/exp_legacy/module/modules/control/vlayer.lua @@ -612,7 +612,11 @@ local function handle_circuit_interfaces() -- Set the item signals based on stored items for item_name, count in pairs(vlayer_data.storage.items) do if prototypes.item[item_name] and count > 0 then - circuit_oc.set_slot(signal_index, { value = { type = "item", name = item_name, quality = "normal" }, min = count }) + local existing_index = circuit_oc.set_slot(signal_index, { value = { type = "item", name = item_name, quality = "normal" }, min = count }) + if existing_index then + circuit_oc.clear_slot(existing_index) + circuit_oc.set_slot(signal_index, { value = { type = "item", name = item_name, quality = "normal" }, min = count }) + end signal_index = signal_index + 1 end end