[1.1.50] Crash with set_chunk_generated_status() + chunk position too big
Posted: Tue Jan 18, 2022 9:53 am
1) What'd you do? Accidentally put a too-large chunk-position into set_chunk_generated_status().
2) What happened?
Reproduction:
The mistake is (1e6 - 5 / 32), which is 999,999 (the 27/32 floored to 0, chunk position is ints).
Log snippet: There are similar reports about unreasonable positions, but I believe when it is caused script-side (as opposed to a corrupted save), there should be a soft error.
viewtopic.php?f=23&t=90831 is a similar report where the resolution is "fix the unreasonable code" while not considering a soft error as the result vs hard crash.
2) What happened?
3) Expected? Soft error.26.197 Error Chunk.cpp:728: Trying to make chunk at unreasonable position [31249, 999999]
Reproduction:
Code: Select all
/c
local player = game.player
local surface = player.surface
surface.set_chunk_generated_status({(1e6-5) / 32, (1e6 - 5 / 32)}, defines.chunk_generated_status.entities)
Log snippet: There are similar reports about unreasonable positions, but I believe when it is caused script-side (as opposed to a corrupted save), there should be a soft error.
viewtopic.php?f=23&t=90831 is a similar report where the resolution is "fix the unreasonable code" while not considering a soft error as the result vs hard crash.