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

minor bug fix

This commit is contained in:
Gerkiz 2021-01-12 12:55:09 +01:00
parent cc0df3d549
commit c12d41d604

View File

@ -84,6 +84,7 @@ local function progress()
local surface = collapse.surface
if not collapse.start_now then
collapse.tiles = nil
return
end
@ -109,11 +110,7 @@ local function progress()
if collapse.specific_entities.enabled then
local position = {tile.position.x + 0.5, tile.position.y + 0.5}
local entities = collapse.specific_entities.entities
for _, e in pairs(
surface.find_entities_filtered(
{area = {{position[1] - 2, position[2] - 2}, {position[1] + 2, position[2] + 2}}}
)
) do
for _, e in pairs(surface.find_entities_filtered({area = {{position[1] - 2, position[2] - 2}, {position[1] + 2, position[2] + 2}}})) do
if entities[e.name] and e.valid and e.health then
e.die()
elseif e.valid then
@ -123,11 +120,7 @@ local function progress()
end
if collapse.kill then
local position = {tile.position.x + 0.5, tile.position.y + 0.5}
for _, e in pairs(
surface.find_entities_filtered(
{area = {{position[1] - 2, position[2] - 2}, {position[1] + 2, position[2] + 2}}}
)
) do
for _, e in pairs(surface.find_entities_filtered({area = {{position[1] - 2, position[2] - 2}, {position[1] + 2, position[2] + 2}}})) do
if e.valid and e.health then
e.die()
end