From 74b9490433705806ad5eb62cd708f1f36d34cdbd Mon Sep 17 00:00:00 2001 From: Timo Smit Date: Wed, 30 Nov 2016 14:20:43 +0100 Subject: [PATCH] Fixed possible floating point error in command logging --- luascripts/commands/commands.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luascripts/commands/commands.lua b/luascripts/commands/commands.lua index eb4d875..e719c64 100644 --- a/luascripts/commands/commands.lua +++ b/luascripts/commands/commands.lua @@ -144,9 +144,9 @@ function commands.log(clientId, command, cmdArguments) if victimId then local victimName = players.getName(victimId) - logLine = string.format("%3i:%02i: %i: %s: %s: %s: %s: %s: %s: \"%s\"\n", math.floor(levelTime / 60), (levelTime % 60), clientId, clientGUID, clientName, clientFlags, command, victimId, victimName, table.concat(cmdArguments, " ", 2)) + logLine = string.format("%3i:%02f: %i: %s: %s: %s: %s: %s: %s: \"%s\"\n", math.floor(levelTime / 60), (levelTime % 60), clientId, clientGUID, clientName, clientFlags, command, victimId, victimName, table.concat(cmdArguments, " ", 2)) else - logLine = string.format("%3i:%02i: %i: %s: %s: %s: %s: \"%s\"\n", math.floor(levelTime / 60), (levelTime % 60), clientId, clientGUID, clientName, clientFlags, command, table.concat(cmdArguments, " ")) + logLine = string.format("%3i:%02f: %i: %s: %s: %s: %s: \"%s\"\n", math.floor(levelTime / 60), (levelTime % 60), clientId, clientGUID, clientName, clientFlags, command, table.concat(cmdArguments, " ")) end et.trap_FS_Write(logLine, string.len(logLine), fileDescriptor)