From 3891e48acd358369d178857e5d7d10c437a1fa33 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Sun, 31 Aug 2025 01:36:03 +0900 Subject: [PATCH] . --- exp_legacy/module/modules/control/protection.lua | 1 + exp_legacy/module/modules/control/vlayer.lua | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/exp_legacy/module/modules/control/protection.lua b/exp_legacy/module/modules/control/protection.lua index 4f0d5c95..79415756 100644 --- a/exp_legacy/module/modules/control/protection.lua +++ b/exp_legacy/module/modules/control/protection.lua @@ -199,6 +199,7 @@ local function event_remove_entity(event) EntityProtection.remove_entity(event.entity) end +Event.add(defines.events.on_space_platform_pre_mined, event_remove_entity) Event.add(defines.events.on_pre_player_mined_item, event_remove_entity) Event.add(defines.events.on_robot_pre_mined, event_remove_entity) Event.add(defines.events.on_entity_died, event_remove_entity) diff --git a/exp_legacy/module/modules/control/vlayer.lua b/exp_legacy/module/modules/control/vlayer.lua index deefad4e..e5f6f59f 100644 --- a/exp_legacy/module/modules/control/vlayer.lua +++ b/exp_legacy/module/modules/control/vlayer.lua @@ -608,7 +608,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