This scripting function doesn't seem to populate the table it returns.
Reproducable by filling a belt, calling get_contents() on one of the belt's lines, and printing the # of the returned table.
[0.12.5] Lua TransportLine get_contents()
Re: [0.12.5] Lua TransportLine get_contents()
#table doesn't work that way for named indexes:
You have to check for the key and then if it isn't nil check the count it returns.
See: http://www.lua.org/manual/5.2/manual.html#3.4.6
You have to check for the key and then if it isn't nil check the count it returns.
See: http://www.lua.org/manual/5.2/manual.html#3.4.6
If you want to get ahold of me I'm almost always on Discord.
Re: [0.12.5] Lua TransportLine get_contents()
What a language, what a wonderful language.
You're completely right, but still, I was sure i did check whether looping worked. Apparently not.
You're completely right, but still, I was sure i did check whether looping worked. Apparently not.