Page 1 of 1

[0.18.30] hard freeze with spill_item_stack in ungenerated map area

Posted: Thu Jun 04, 2020 2:31 am
by Therax
Discovered by creating a new surface:

Code: Select all

/c game.create_surface("test").spill_item_stack({0,0}, {name="iron-plate", count=1})
but also reproducible on nauvis by pointing to an area of the map yet to be generated:

Code: Select all

/c game.surfaces[1].spill_item_stack({500000,500000},{name="iron-plate",count=1})
Observed behavior: the game process locks up and becomes unresponsible. It appears that the game locks up searching fruitlessly for an available place to create the item-on-ground entity.

Expected behavior: any of 1) Lua error, 2) graceful failure and not creating the item-on-ground, or 3) give up on the search after a reasonable amount of time and create the item-on-ground at the specified position, since it appears to be okay to do so via create_entity.

Re: [0.18.30] hard freeze with spill_item_stack in ungenerated map area

Posted: Thu Jun 04, 2020 4:47 am
by Rseding91
Thanks for the report however that's kind of just "how it has to work" The logic is made to search until the limit is reached. Basically... stop hitting yourself. Don't ask the game to do something that isn't possible since determining if it is possible would take as much time as it takes to just do the entire search.