From 27063e0eef8618f43716fc7247aa2aad05fe85c4 Mon Sep 17 00:00:00 2001 From: plague006 Date: Tue, 23 Oct 2018 22:12:25 -0400 Subject: [PATCH] Local count_entities_filtered --- map_gen/misc/nightfall.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/map_gen/misc/nightfall.lua b/map_gen/misc/nightfall.lua index bd98158c..7a14f58f 100644 --- a/map_gen/misc/nightfall.lua +++ b/map_gen/misc/nightfall.lua @@ -33,6 +33,7 @@ local c_index local random = math.random local insert = table.insert local get_pollution = game.surfaces[1].get_pollution +local count_entities_filtered = game.surfaces[1].count_entities_filtered local function biter_attack() local maxindex = #bases @@ -93,7 +94,7 @@ local function find_bases() end if get_pollution(chunklist[i]) > 0.1 then local chunkcoord = chunklist[i] - if (game.surfaces[1].count_entities_filtered{area={{chunkcoord.x-16, chunkcoord.y-16},{chunkcoord.x+16, chunkcoord.y+16}}, + if (count_entities_filtered{area={{chunkcoord.x-16, chunkcoord.y-16},{chunkcoord.x+16, chunkcoord.y+16}}, type = "unit-spawner"}) > 0 then insert(bases,chunkcoord) end