function Corridorx1North(a,b,length, t)
for i = 1, length do
t[#t+1] = {tile = 9, x = a-map.tilesize, y = b+map.tilesize*length}
t[#t+1] = {tile = 1, x = a, y = b+map.tilesize*length}
t[#t+1] = {tile = 11, x = a+map.tilesize, y = b+map.tilesize*length}
end
return t
end
Is there someway to input the sub-table values back into the table t?
Bindie wrote:
Is there someway to input the sub-table values back into the table t?
Umm can you clarify a bit more what do you mean? In your code example you are adding tables into table t. Also the t you pass into the function does get altered.
local function testFunc( t )
t.x = 200
return t
end
local temp = {}
local temp2 = testFunc(temp)
print( temp2.x ) -- prints 200
print( temp.x ) -- also prints 200
Although I do not think this is what you are meaning, so I guess giving bit better description of what you want to do would help out a lot.