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

Merge pull request #678 from plague006/revive_ghosts

Add revive ghosts
This commit is contained in:
Matthew 2019-02-02 17:46:46 -05:00 committed by GitHub
commit a8dda1eaac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -241,6 +241,15 @@ local function teleport_command(args, player)
end
end
--- Revives ghosts around the player
local function revive_ghosts(args, player)
local radius = args.radius
local pos = player.position
for _, e in pairs(player.surface.find_entities_filtered {area = {{pos.x - radius, pos.y - radius}, {pos.x + radius, pos.y + radius}}, type = 'entity-ghost'}) do
e.revive()
end
end
-- Event registrations
Event.add(defines.events.on_built_entity, built_entity)
@ -376,3 +385,14 @@ Command.add(
},
teleport_command
)
Command.add(
'revive-ghosts',
{
description = 'Revives the ghosts within the provided radius around you',
arguments = {'radius'},
default_values = {radius = 10},
admin_only = true
},
revive_ghosts
)