Skip to content

Commit c1053ee

Browse files
TheNormalnijpatrikjuvonen
authored andcommitted
Improved iprint function (#1064)
* Fix iprint works with nil values * Small optimization/ * Update make_uname.bat
1 parent e1ac7e2 commit c1053ee

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Shared/mods/deathmatch/logic/luascripts/inspect.lua.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ inspect ={
4242
}
4343
local mta_type
4444
local tostring = tostring
45+
local table_concat = table.concat
46+
local select = select
4547
4648
inspect.KEY = setmetatable({}, {__tostring = function() return 'inspect.KEY' end})
4749
inspect.METATABLE = setmetatable({}, {__tostring = function() return 'inspect.METATABLE' end})
@@ -401,14 +403,10 @@ end
401403
402404
function iprint(...)
403405
local arg = {...}
404-
local s = ""
405-
for i,arg in ipairs(arg) do
406-
if i > 1 then
407-
s = s .. " "
408-
end
409-
s = s .. inspect(arg)
406+
for i = 1, select("#",...) do
407+
arg[i] = inspect(arg[i])
410408
end
411-
outputDebugString(s,3,180,180,180)
409+
outputDebugString(table_concat(arg," "),3,180,180,180)
412410
end
413411
414412
-------------------------------------------------------------------

0 commit comments

Comments
 (0)