1
0
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:
plague006 2019-02-02 01:04:41 -05:00 committed by Matthew Heguy
parent a18585860c
commit e7cd23e3ff

View File

@ -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
)