From f3edf43bbda1ab4fa7a1af00b9f5c3a082bc977f Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Wed, 31 Jan 2024 08:07:31 +0900 Subject: [PATCH] Update lawnmower.lua (#275) --- modules/commands/lawnmower.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/commands/lawnmower.lua b/modules/commands/lawnmower.lua index 2f5fca03..13538416 100644 --- a/modules/commands/lawnmower.lua +++ b/modules/commands/lawnmower.lua @@ -13,10 +13,12 @@ Commands.new_command('lawnmower', 'Clean up biter corpse, decoratives and nuclea player.surface.destroy_decoratives({position=player.position, radius=range}) - local entities = player.surface.find_entities_filtered{position=player.position, radius=range, type='corpse', name={'transport-caution-corpse', 'invisible-transport-caution-corpse'}} + local entities = player.surface.find_entities_filtered{position=player.position, radius=range, type='corpse'} for _, entity in pairs(entities) do - entity.destroy() + if not (entity.name == 'transport-caution-corpse') and not (entity.name == 'invisible-transport-caution-corpse') then + entity.destroy() + end end local tiles = player.surface.find_tiles_filtered{position=player.position, radius=range, name={'nuclear-ground'}}