mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-18 03:21:47 +02:00
Add destroy command
This commit is contained in:
parent
a18585860c
commit
e7cd23e3ff
@ -331,6 +331,16 @@ local function revive_ghosts(args, player)
|
||||
end
|
||||
end
|
||||
|
||||
local function destroy(_, player)
|
||||
local ent = player.selected
|
||||
if ent then
|
||||
Game.player_print(ent.name .. ' destroyed')
|
||||
ent.destroy()
|
||||
else
|
||||
Game.player_print('Nothing found to destroy.')
|
||||
end
|
||||
end
|
||||
|
||||
-- Event registrations
|
||||
|
||||
Event.add(defines.events.on_built_entity, built_entity)
|
||||
@ -499,3 +509,12 @@ Command.add(
|
||||
},
|
||||
Apocalypse.begin_apocalypse
|
||||
)
|
||||
|
||||
Command.add(
|
||||
'destroy',
|
||||
{
|
||||
description = 'Destroys the entity under your cursor',
|
||||
admin_only = true
|
||||
},
|
||||
destroy
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user