From 5e244273c240f4bc14ecbcd842503b10367aacb7 Mon Sep 17 00:00:00 2001 From: Wilma456 Date: Thu, 29 Jun 2017 17:58:53 +0200 Subject: [PATCH] Allow Number and Table --- .../assets/computercraft/lua/rom/apis/textutils.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/resources/assets/computercraft/lua/rom/apis/textutils.lua b/src/main/resources/assets/computercraft/lua/rom/apis/textutils.lua index 351ff2d4a..a160f4b7f 100644 --- a/src/main/resources/assets/computercraft/lua/rom/apis/textutils.lua +++ b/src/main/resources/assets/computercraft/lua/rom/apis/textutils.lua @@ -108,14 +108,9 @@ end local function tabulateCommon( bPaged, ... ) local tAll = { ... } - for i=1,#tAll,2 do - if type( tAll[i] ) ~= "number" then - error( "bad argument #"..i.." (expected number, got " .. type( tAll[i] ) .. ")", 3 ) - end - end - for i=2,#tAll,2 do - if type( tAll[i] ) ~= "table" then - error( "bad argument #"..i.." (expected table, got " .. type( tAll[i] ) .. ")", 3 ) + for k,v in ipairs( tAll ) do + if type( v ) ~= "number" and type( v ) ~= "table" then + error( "bad argument #"..k.." (expected number/table, got " .. type( v ) .. ")", 3 ) end end