1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-22 03:38:48 +02:00

fix for soft reset deleting deconstructed entities

soft reset deletes entities before they can get unmarked for deconstruction
This commit is contained in:
hanakocz 2020-03-13 19:26:43 +01:00 committed by GitHub
parent a27c53ef52
commit 339189c8d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
Event.add(defines.events.on_marked_for_deconstruction, on_marked_for_deconstruction)