mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-18 03:21:47 +02:00
commit
a8dda1eaac
@ -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
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user