mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
Add debug_commands
This commit is contained in:
parent
891a863e68
commit
e0699036f8
22
features/debug_commands.lua
Normal file
22
features/debug_commands.lua
Normal file
@ -0,0 +1,22 @@
|
||||
local Command = require 'utils.command'
|
||||
local Ranks = require 'resources.ranks'
|
||||
|
||||
Command.add(
|
||||
'reveal',
|
||||
{
|
||||
description = {'command_description.reveal'},
|
||||
arguments = {'radius'},
|
||||
default_values = {radius = 500},
|
||||
required_rank = Ranks.admin,
|
||||
debug_only = true,
|
||||
allowed_by_server = true
|
||||
},
|
||||
function(args, p)
|
||||
local radius = args.radius
|
||||
if not p then
|
||||
p = {force = game.forces.player, surface = game.surfaces.redmew or game.surfaces.nauvis, position = {x = 0, y = 0}}
|
||||
end
|
||||
local pos = p.position
|
||||
p.force.chart(p.surface, {{pos.x - radius, pos.y - radius}, {pos.x + radius, pos.y + radius}})
|
||||
end
|
||||
)
|
Loading…
Reference in New Issue
Block a user