From 339189c8d5fa04c96902b639cc85c967b2aacf1f Mon Sep 17 00:00:00 2001 From: hanakocz Date: Fri, 13 Mar 2020 19:26:43 +0100 Subject: [PATCH] fix for soft reset deleting deconstructed entities soft reset deletes entities before they can get unmarked for deconstruction --- modules/no_deconstruction_of_neutral_entities.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/no_deconstruction_of_neutral_entities.lua b/modules/no_deconstruction_of_neutral_entities.lua index 86c86f2a..5b59c788 100644 --- a/modules/no_deconstruction_of_neutral_entities.lua +++ b/modules/no_deconstruction_of_neutral_entities.lua @@ -5,6 +5,7 @@ local blacklist = { local function on_marked_for_deconstruction(event) local entity = event.entity + if not entity.valid then return end if not event.player_index then return end if entity.force.name ~= "neutral" then return end if blacklist[entity.type] then return end @@ -12,4 +13,4 @@ local function on_marked_for_deconstruction(event) end local Event = require 'utils.event' -Event.add(defines.events.on_marked_for_deconstruction, on_marked_for_deconstruction) \ No newline at end of file +Event.add(defines.events.on_marked_for_deconstruction, on_marked_for_deconstruction)