LuaSurface::spill_item_stack does not return when no max_radius is given and there is no position anywhere in the surface's generated chunks that will hold the item. The game stops responding. It does not raise an error, it does not log anything, and it does not come back on its own; killing the process is the only way out.
Steps to reproduce
From a single player game. Each of these is one line -- paste it into the console and press enter. /c disables achievements for the save, which is what a reproduction costs.
1. Make a surface of its own and drown every generated chunk of it, so there is nowhere on that surface that will hold an item on the ground (but this also happens on natural space platforms):
Code: Select all
/c local s = game.create_surface("drowned") s.request_to_generate_chunks({0,0}, 2) s.force_generate_chunk_requests() for c in s.get_chunks() do local t = {} for x = c.area.left_top.x, c.area.right_bottom.x-1 do for y = c.area.left_top.y, c.area.right_bottom.y-1 do t[#t+1] = {name="deepwater", position={x,y}} end end s.set_tiles(t) end game.print("surface "..s.name..", dry land left: "..#s.find_tiles_filtered{area={{-512,-512},{512,512}}, collision_mask="player", invert=true})2. The control. The same spill with a max_radius:
Code: Select all
/c game.print("bounded call returned, made "..#game.surfaces["drowned"].spill_item_stack{position={0.5,0.5}, stack={name="iron-plate", count=1}, max_radius=8})3. The same spill again with max_radius left out:
Code: Select all
/c game.print("unbounded call returned, made "..#game.surfaces["drowned"].spill_item_stack{position={0.5,0.5}, stack={name="iron-plate", count=1}})Expected: the third command returns when it runs out of places to search, even if it failed to place.

