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:
parent
a27c53ef52
commit
339189c8d5
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user