From c12d41d6046767b0d2a847491b8ac6203f08a554 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Tue, 12 Jan 2021 12:55:09 +0100 Subject: [PATCH] minor bug fix --- modules/collapse.lua | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/collapse.lua b/modules/collapse.lua index a378b695..d5a7d846 100644 --- a/modules/collapse.lua +++ b/modules/collapse.lua @@ -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