1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-03 14:53:01 +02:00

Updated grief check

- Changed grief check to use xpos, ypos and radius
- Tested it works
This commit is contained in:
Jayefuu 2020-11-20 21:43:19 +00:00
parent b25547c160
commit 45759bd39c

View File

@ -253,8 +253,7 @@ local function strike(args, player)
-- Do a simple check to make sure the player isn't trying to grief the base
--local enemyEntities = s.find_entities_filtered {position = {xpos, ypos}, radius = radius, force = "enemy"}
local enemyEntities = game.player.surface.find_entities_filtered {area={{100,-100},{-100,100}}, force = "enemy"}
game.print(#enemyEntities)
local enemyEntities = player.surface.find_entities_filtered {position = {xpos,ypos}, radius=radius+30, force = "enemy"}
if #enemyEntities < 1 then
player.print("You don't want to do that, no enemies found in the target area.")
for _, p in pairs(game.players) do