I have two identical tables (or I think they are). When I JSON encode and decode each, one has data and the other doesn’t. Please check out the code below to better understand my problem. Any ideas?
local map1 = { {0,1,0,1,0}, {0,1,0,1,0}, {0,1,1,1,0}, {0,0,0,0,0}, } local map2 = {} for y=0,4 do map2[y] = {} for x=0,6 do map2[y][x] = 0 end end local encodedMap1 = json.encode( map1 ) local decodedMap1 = json.decode( encodedMap1 ) print ("map 1 length after: " .. #decodedMap1) -- results in 4 local encodedMap2 = json.encode( map2 ) local decodedMap2 = json.decode( encodedMap2 ) print ("map 2 length after: " .. #decodedMap2) -- results in 0