From a4b68e3c3adc313d59dfe50bf49caa68e041323b Mon Sep 17 00:00:00 2001 From: Hermios Date: Tue, 7 May 2024 17:34:44 +0300 Subject: [PATCH] when entity destroyed, check that is connected to the current mod --- control.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/control.lua b/control.lua index 039e3c3..8d92e84 100644 --- a/control.lua +++ b/control.lua @@ -38,6 +38,9 @@ end) table.insert(list_events.on_entity_destroyed,function(event) local destroyed_item_data=destroyed_railpoles[event.unit_number] + if not destroyed_item_data then + return + end local ghosts=destroyed_item_data.surface.find_entities_filtered{position=destroyed_item_data.position,name="entity-ghost",ghost_name=railpole} if #ghosts>0 then local old_ghost=ghosts[1]