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

fixed dual use of same variable name 'target' in custom_commands.lua:jail

This commit is contained in:
Maik Wild 2018-11-18 13:19:41 +01:00
parent 1e5ea9c58f
commit ab04ac5b4c

View File

@ -482,12 +482,12 @@ local function jail_player(cmd)
return
end
-- Check if the target is valid
local target = cmd['parameter']
if target == nil then
local target_name = cmd['parameter']
if not target then
Game.player_print('Usage: /jail <player>')
return
end
local target = game.players[cmd['parameter']]
local target = game.players[target_name]
Report.jail(target, player)
end