1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-28 03:56:53 +02:00

fix command logging

This commit is contained in:
grilledham 2018-07-03 20:08:39 +01:00
parent cc0f98ee8b
commit bbf820e103

View File

@ -168,13 +168,14 @@ Event.add(
function(event)
local command = event.command
if command == 'c' or command == 'command' or command == 'silent-command' or command == 'hax' then
local player = game.players[event.player_index]
if player then
player = player.name
local p_index = event.player_index
local name
if p_index then
name = game.players[event.player_index].name
else
player = '<server>'
name = '<server>'
end
local s = table.concat {'[Command] ', player, ' /', command, ' ', event.parameters}
local s = table.concat {'[Command] ', name, ' /', command, ' ', event.parameters}
log(s)
end
end