Page 1 of 1

[0.9]settiles works fine, but crash when data isn't in array

Posted: Sat Feb 15, 2014 8:18 am
by rk84

Code: Select all

game.settiles({{name="sand",position={-50,-50}}}) -- works fine
game.settiles({name="sand",position={-50,-50}}) -- crash
Edit: Actually this might be false alarm. I got normal error message on second time.

Re: [0.9]settiles works fine, but crash when data isn't in a

Posted: Sat Feb 15, 2014 9:37 pm
by ficolas
Not a bug.

You can specify more than one table so it sets more than one tiles at the same time.
Its weird but yea.

Re: [0.9]settiles works fine, but crash when data isn't in a

Posted: Sat Feb 15, 2014 10:44 pm
by immibis
ficolas wrote:Not a bug.

You can specify more than one table so it sets more than one tiles at the same time.
Its weird but yea.
Crashing instead of raising a Lua error is a bug.

Re: [0.9]settiles works fine, but crash when data isn't in a

Posted: Sat Feb 15, 2014 11:02 pm
by ficolas
I didnt mean that the crash is not a bug, only that you need to put a table inside a table.
Also it doesnt give error message when crashing because the name of the tole doesnt exist.

Re: [0.9]settiles works fine, but crash when data isn't in a

Posted: Mon Feb 17, 2014 9:55 pm
by kovarex
The reason it is table in table is, that it is much less performance heavy to change a batch of files in one run than to call one by one, because the engine than has to do the tile border and variation corrections.

Re: [0.9]settiles works fine, but crash when data isn't in a

Posted: Mon Feb 17, 2014 10:04 pm
by kovarex
Anyway, the crash is a bug, and it is now fixed for 0.9.1