[0.12.29][Twinsen] Game crashed due to calling set_tiles

This subforum contains all the issues which we already resolved.
Post Reply
enkindle
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri Mar 18, 2016 6:44 am
Contact:

[0.12.29][Twinsen] Game crashed due to calling set_tiles

Post by enkindle »

I managed to crash the game working on a mod. Here is the relevant code:

Code: Select all

	
	local pos = position -- this is just the player position
	local full_size = {width=10, height=10}
	local full_area = {left_top = {x = pos.x - full_size.width / 2, y = pos.y - full_size.height}, right_bottom = {x = pos.x + full_size.width / 2, y = pos.y}}
	local new_tiles = {}
	
	for x, y in iarea(area) do
		table.insert(new_tiles, {name = "water", position = {x, y}})
	end
	
	surface.set_tiles(new_tiles)
All entities in the area were destroyed before running this code.

I've attached the mod, map save and log. Just load the save with the mod and place the smart chest.
Attachments
Frogger Testing.zip
(847.45 KiB) Downloaded 131 times
Frogger_0.0.1.zip
(47.37 KiB) Downloaded 117 times
factorio-current.log
(10.47 KiB) Downloaded 157 times

enkindle
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri Mar 18, 2016 6:44 am
Contact:

Re: [0.12.29] Game crashed due to calling set_tiles

Post by enkindle »

Ah, additional note: This only happens when you try to set_tiles where the player is, so place the chest below the player.

Twinsen
Factorio Staff
Factorio Staff
Posts: 1329
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [0.12.29][Twinsen] Game crashed due to calling set_tiles

Post by Twinsen »

It was happening because you were spawning water under the player, thus killing him.

Fixed in 0.12.30. It will not crash, but the game will end because you die.
Thanks for the clear report, save+mod+log made it easy to fix.

enkindle
Burner Inserter
Burner Inserter
Posts: 15
Joined: Fri Mar 18, 2016 6:44 am
Contact:

Re: [0.12.29][Twinsen] Game crashed due to calling set_tiles

Post by enkindle »

Yeah, eventually figured* that out, made me feel a bit silly.

Post Reply

Return to “Resolved Problems and Bugs”