1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-08 00:39:30 +02:00
ComfyFactorio/modules/no_deconstruction_of_neutral_entities.lua

9 lines
376 B
Lua
Raw Normal View History

2019-08-06 03:04:35 +02:00
local event = require 'utils.event'
local function on_marked_for_deconstruction(event)
if event.entity.force.name ~= "neutral" then return end
2019-10-27 20:26:55 +02:00
if event.entity.name == "item-on-ground" then return end
2019-08-06 03:04:35 +02:00
event.entity.cancel_deconstruction(game.players[event.player_index].force.name)
end
event.add(defines.events.on_marked_for_deconstruction, on_marked_for_deconstruction)