1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00
RedMew/features/debug_tools.lua

23 lines
714 B
Lua
Raw Normal View History

2019-03-02 23:45:07 +02:00
local Command = require 'utils.command'
local Ranks = require 'resources.ranks'
Command.add(
2019-03-04 00:54:51 +02:00
'debug-reveal',
2019-03-02 23:45:07 +02:00
{
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
)