From c83f39c1710c1acaa318704b275222cc4f40e316 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Fri, 3 May 2019 09:32:15 +0200 Subject: [PATCH] e.force.name ~= "player" --- maps/fish_defender/bouncy_shells.lua | 2 +- maps/fish_defender/ultra_mines.lua | 2 +- maps/mountain_fortress.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maps/fish_defender/bouncy_shells.lua b/maps/fish_defender/bouncy_shells.lua index d384c6c2..54303c67 100644 --- a/maps/fish_defender/bouncy_shells.lua +++ b/maps/fish_defender/bouncy_shells.lua @@ -23,7 +23,7 @@ local function bounce(surface, position, ammo) local valid_entities = {} for _, e in pairs(surface.find_entities_filtered({area = {{position.x - radius, position.y - radius},{position.x + radius, position.y + radius}}})) do if e.health then - if e.force.name ~= "character" then + if e.force.name ~= "player" then local distance_from_center = math_sqrt((e.position.x - position.x) ^ 2 + (e.position.y - position.y) ^ 2) if distance_from_center <= radius then valid_entities[#valid_entities + 1] = e diff --git a/maps/fish_defender/ultra_mines.lua b/maps/fish_defender/ultra_mines.lua index 9680cc29..63e2d402 100644 --- a/maps/fish_defender/ultra_mines.lua +++ b/maps/fish_defender/ultra_mines.lua @@ -4,7 +4,7 @@ local radius = 8 local function damage_entities_around_target(entity, damage) for _, e in pairs(entity.surface.find_entities_filtered({area = {{entity.position.x - radius, entity.position.y - radius},{entity.position.x + radius, entity.position.y + radius}}})) do if e.health then - if e.force.name ~= "character" then + if e.force.name ~= "player" then local distance_from_center = math.sqrt((e.position.x - entity.position.x) ^ 2 + (e.position.y - entity.position.y) ^ 2) if distance_from_center <= radius then e.damage(damage, "player", "explosion") diff --git a/maps/mountain_fortress.lua b/maps/mountain_fortress.lua index baf0290e..9318660c 100644 --- a/maps/mountain_fortress.lua +++ b/maps/mountain_fortress.lua @@ -414,7 +414,7 @@ local function on_chunk_generated(event) if left_top.y ~= 0 then return end if left_top.x ~= 96 then return end for _, e in pairs(surface.find_entities_filtered({area = {{spawn_point.x - 0.5, spawn_point.y - 0.5},{spawn_point.x + 0.5, spawn_point.y + 0.5}}})) do - if e.force.name ~= "character" then + if e.force.name ~= "player" then e.destroy() end end